Home

Very beginer level __ User input __

This is the part of the code:

System.Console.Write("how many numbers:");
n= Int32.Parse(System.Console.ReaLine());

I have this message ;

How many numbers

Then i am supposed to enter a number isnt it ?
But dont get where ?

Comments


  • first, you have a type mistake: ReaLine must be ReadLine.
    second, I do not know if you have previously declared n as int variable.

    If you write like this:
    System.Console.Write("how many numbers:");
    var n = Int32.Parse(System.Console.ReadLine());
    you have a black line in buttom:
    image
  • In LINQPad, there is also a convenient shortcut for this:
    var n = Util.ReadLine<int> ("How many numbers?");
    n.Dump();
    
Sign In or Register to comment.