I am just starting out on my coding journey and attempting to learn C#. I simply want this program to ask the user for two integers named myInt and yourInt and output the total. I feel like I am close to completing this but am running into an issue with the string to integer conversion. Please see code below:
static void Main(string[] args)
{
string userInput;
string user_Input;
int myInt = 0;
int yourInt = 0;
int total = myInt + yourInt;
Console.WriteLine("What is my Integer?");
userInput = Console.ReadLine();
myInt = Convert.ToInt32(userInput);
Console.WriteLine("What is your integer?");
user_Input = Console.ReadLine();
yourInt = Convert.ToInt32(user_Input);
Console.WriteLine("Our integer is " + total);
}
I continually receive the following error: "Cannot implicitly convert type 'int' to 'string'...