I need help understanding what might be wrong with this simple C # console program. I want to perform various arithmetic operations through classes. Here is the program.
static void Main(string[] args) { Console.Clear(); Arithmetic a1 = new Arithmetic(); Console.Write("\nEnter the value for first variable\n"); a1.obj1 = Console.Read(); Console.Write("\nEnter the value for the second variable\n"); a1.obj2 = Console.Read(); Console.WriteLine("Press any key to exit"); Console.ReadKey(); }
Apparantley, the program builds and compiles ok, but at run time it takes the value of the first integer and does not take the value of the next integer, it writes the last line on the display (press any key to exit)
source share