I am new to C# and the .NET Code / VSCcode.
Currently using VSCode to run and build C# codes.
I am unable to take user input using Console.ReadLine() after declaring a particular variable to hold it. The terminal generates this error code at the end of the program:
The program '[4544] forth.dll' has exited with code 0 (0x0).
using System;
namespace forth
{
class Program
{
static void Main(string[] args)
{
Console.WriteLine("Hello World!");
Console.WriteLine("This is the first program we are trying to build");
var name = Console.ReadLine();
Console.WriteLine("Hello " + name, "you successfully entered a name");
Console.WriteLine("Hello " + name, "you successfully entered a name");
Console.WriteLine("you can press enter to exit the program");
Console.ReadLine();
}
}
}
Output "please enter your name" and displays "Hello + the user's name"
The program should exist afterwards
code 0 (0x0)means "there's no more code to run, the program exited successfully". It's not clear what happens or what you expect to happen