c#
The last statement won't run c#! [duplicate]
This question already has an answer here: Why is the console window closing immediately without displaying my output? 18 answers Please help! I ran this program and entered all 3 inputs but the last writeline code wouldn't run and the program just exits itself! I have no idea because I follow the book exactly! string userName = ""; int userAge = 0; int currentYear = 0; Console.Write("Please enter your name: "); userName = Console.ReadLine(); Console.Write("Please enter your age: "); userAge = Convert.ToInt32(Console.ReadLine()); Console.Write("Please enter the current year: "); currentYear = Convert.ToInt32(Console.ReadLine()); Console.WriteLine("Hello World! My name is {0} and I am {1} years old. I was born in {2}.", userName, userAge, currentYear - userAge);
at the end of the code add: Console.ReadLine();
Related Links
Invoking WPF Dispatcher with anonymous method
How to make this code DRY?
ManagementScope and Win32_Product retrieving executable paths
Response.Redirect from one web project to another in Visual Studio
Insert rows into Access Table in order from c#
Host TCP Chat Server in IIS
hooks in function argument to accommodate future data?
Change datetime to date in MVC 3 C#
Default state of the systray icon
Help in understanding project euler's question #54
XtraGrid Questions
Add table dynamically in Entity framework in MVC
How i can get the word who user type for a special word in non-english language in any language even c# , javascript
Rich Text box Properties problem
Large dataset in memory - .NET Framework and C#
Entity Framework Code First 0 to 1 mapping