Search code examples
c#console.readline

console.readline display something before


I have something like this:

Console.WriteLine("Y =");
Y = Convert.ToInt32(Console.ReadLine());

and it displays like this

Y=
//and here i have to input my value

I want to put my value on the same row

Y= //here to input my value

Any tips?


Solution

  • Then you neeed

    Console.Write("Y = ");
    

    instead of

    Console.WriteLine("Y = ");