|
using System;
class Test_Add
{
static void Main ()
{
int x, y;
Console.Write ("Please enter x:");
x = Console.Read ();
Console.Write ("Please enter y:");
y = Console.Read ();
x = x + y;
Console.WriteLine ("x + y = {0}", x);
Console.WriteLine ("Please press Enter to end!");
Console.Read ();
}
}
// Question: When I execute the program, I am prompted for x, but when I enter x and press Enter, the result is displayed directly! Why is that? |
|