J
Jerry
I am having problem with Console.Read(), the Value I
entered is not the value that store in my variable.
public class Num
{
int num;
Console.Write("Enter a number: ");
num=Console.Read();
Console.WriteLine("{0}",num)
}
every time i test this code, I enter 1, but the value
store in num is 49, which mean i got 49 as output, i
enter 2, I got 50. does anyone know, why this happen and
any solutions for it. it sounds like the program take 1
and converted to ascII code, and stored at num. Help
please, thank you.
entered is not the value that store in my variable.
public class Num
{
int num;
Console.Write("Enter a number: ");
num=Console.Read();
Console.WriteLine("{0}",num)
}
every time i test this code, I enter 1, but the value
store in num is 49, which mean i got 49 as output, i
enter 2, I got 50. does anyone know, why this happen and
any solutions for it. it sounds like the program take 1
and converted to ascII code, and stored at num. Help
please, thank you.