Console.Write not working

  • Thread starter Thread starter Bryan.B.L
  • Start date Start date
B

Bryan.B.L

Guest
I downloaded Visual Studio 2019 for Mac. I have the following C# code:


using System;

namespace Variables
{
class Program
{
static void Main(string[] args)
{
string myFirstName;
Console.WriteLine("What is your name?");
Console.Write("Type in your first name: ");
myFirstName = Console.ReadLine();

string myLastName;
Console.Write("Type is your last name: ");
myLastName = Console.ReadLine();

Console.WriteLine("Hello, " + myFirstName + " " + myLastName);
Console.ReadLine();
}
}
}



However, when I run it on the Visual Studio Application Output, I only get "What is your name?". And that's it. It doesn't show the rest, I cannot see "Type in your fist name: ".

Also, when I try executing it on an external console, the terminal doesn't execute the code at all!

Does anyone know how I can get this to work?

Continue reading...
 
Back
Top