0

What is exactly the function of "Console.WriteLine"?

Any codeline that comes after the first console.writeline doesn't print on the console (command prompt) why?

20th Dec 2016, 8:10 PM
Kamal Tudunwada
Kamal Tudunwada - avatar
4 Respostas
+ 3
Hi and welcome to the community! Write.Line() is a function: Writes the current line terminator to the standard output stream. Console.WriteLine() is a method: Writes data, followed by the current line terminator, to the standard output stream. Basically, what you decide to add as a string will be typen in either output when running the program. Unfortunately... Sololearn is not supported to this method. The same goes to importing modules or any way to debug. Hope this helped. Dr.
20th Dec 2016, 10:53 PM
Tristan McCullen
Tristan McCullen - avatar
+ 1
Do you have sample code?
20th Dec 2016, 8:32 PM
Gabe Rust
Gabe Rust - avatar
0
Output goes to the standard output stream "Output Type" (Project > [Project Name] Properties > Application > Output type). select where you want your output to go from the drop down. The System.Console class exposes various methods that I suggest further researching.
20th Dec 2016, 8:38 PM
Mark Beleski
Mark Beleski - avatar
0
here is the code sample: using System; class OddOrEven { static void Main() { Console.WriteLine("Please enter a number to see if it is odd or even."); int number = int.Parse(Console.ReadLine()); if (number % 2 == 0) { Console.WriteLine("The number is even"); } else { Console.WriteLine("The number is odd"); } } } for the whole these lines of codes the only output it prints on the console (command prompt) is "Please enter a number to see if it is odd or even"
21st Dec 2016, 5:52 AM
Kamal Tudunwada
Kamal Tudunwada - avatar