C#C
C#3y ago
aj

❔ issues with variable

I have this variable called "remChar"

var remChar = Console.ReadLine().ToUpper();

while (remChar == "YES" || remChar == "Y")


I want to access the variable later on in the while loop so I can change the information in the variable to look for if it says "No", but when I try to implement it into the code it says " A local or parameter named 'remChar' cannot be declared in this scope because that name is used in an enclosing local scope to define a local or parameter"

How would I go by using the variable later on in the code?

thank you :)
Was this page helpful?