Variable does not exist in the current context?

Define it outside the while:

string cust_num = null;
while ...

and then inside the while set it like this:

cust_num = Console.ReadLine();

because you’re trying to access it after the while:

return cust_num;

Leave a Comment