Question

Write as assignment statement that assigns WA to an existing string variable state. Visual Studio 2019....

Write as assignment statement that assigns WA to an existing string variable state. Visual Studio 2019. Language C#.

0 0
Add a comment Improve this question Transcribed image text
Answer #1

The above question can be solved in the following steps-

STEP 1- First we will the variable name of the existing string variable.

STEP 2- Then using that variable name, we will assign the value "WA" to that variable by using the assignment operator( = ) which assigns value to a variable.

STEP 3- Then print the value to check if it has been assigned properly.

C# Code-

using System;
class HelloWorld {
//main method
static void Main() {
//look at the variable name of Existing String
String state = "Existing Value";
  
//then use the equal to operator(assignment operator)
//to assign WA to the string variable
state = "WA";
//print the value of string variable to check if its been assigned
Console.WriteLine("\nValue of string after assigning = "+state);
}
}

Image of Code-

Output-

If this answer helps, please give an up vote and feel free to comment for any query.

Add a comment
Know the answer?
Add Answer to:
Write as assignment statement that assigns WA to an existing string variable state. Visual Studio 2019....
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT