How to hold output in cmd? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

How to hold output in cmd?

hold output in cmd

13th Jul 2016, 2:52 PM
Ashraf Choudhary
Ashraf Choudhary - avatar
4 Answers
+ 3
write a Console.Read(); before the end of your main function. it will wait for you to press any key before returning to your code.
13th Jul 2016, 4:18 PM
Aastha Aneja
Aastha Aneja - avatar
+ 3
Or you can write Console.ReadKey(); or u can even specify a key. This will stop the output until a key or The key is pressed.
13th Jul 2016, 10:48 PM
Máté Lencsés
Máté Lencsés - avatar
+ 1
For visual studio, run the program by pressing Ctrl+F5 so it wouldnt close the program immediately
14th Jul 2016, 8:19 AM
Nikorasu Chan (Nichii)
Nikorasu Chan (Nichii) - avatar
0
thank you very much
14th Jul 2016, 8:11 AM
Ashraf Choudhary
Ashraf Choudhary - avatar