0

Why can't I see hello world in the black screen???

I am using mycrosoft visual for c# programs.But when I use writeline function ,such as, console.writeline("hello world").It opens a black screen and close it so quickly that I am unable to find what it has printed.what should I do under this circumstance?

25th Jan 2017, 3:58 AM
Sadatul islam Sadi
Sadatul islam Sadi - avatar
3 Answers
+ 5
Visual Studio doesn't prompt you to close the window. When the code is done, it closes on its own. Put Console.ReadKey(); or Console.ReadLine(); as the last line of your code so it waits for an input.
25th Jan 2017, 4:08 AM
Tamra
Tamra - avatar
+ 1
the opening and closing shows your program ran successfully. try something like console.writeline("hello world! "); console.readline(); readline is used for input, so you'll be able to see your output for hello world as the console windows waits for input in order to close. see more of this codes on my profile
25th Jan 2017, 3:11 PM
Tuchy
Tuchy - avatar
+ 1
Console.Read(); use this
26th Jan 2017, 11:00 AM
Catalin Popinciuc
Catalin Popinciuc - avatar