Home>Article>Backend Development> What does console.WriteLine mean in c language?
##Console.Write() and Console.WriteLine() are both methods provided by System.Console. They are mainly used to convert the output stream to the specified output. The device (default is the screen) is displayed.console.WriteLine refers to output to the screen. It is often used in console programs. The output content is one line. The Console.WriteLine() method outputs the string to be output together with the newline control character. When the statement is executed, the cursor will move to the next line of the currently output string.
Console.WriteLine("a");Console.WriteLine("b")will be output on 2 lines
a band
Console.Write("a");Console.Write("b")will be output on the same line
a bUse line break output: Console.WriteLine
Use non-line break output: Console.Write
// 在控制台上打印 Hello World! Console.WriteLine("Hello World !"); //换行打印 Console.Write("hello"); //不换行打印 Console.Write("--"); Console.Write("world"); Console.ReadKey();//ReadKey()运行完结果不退出控制台
C# console Input/output statement
Console.Read() method: Read a character from the console window and return an int value Console.ReadLine() method: Read from the console window Take a line of text and return the string value Console.ReadKey() method: Monitor keyboard events, which can be understood as pressing any key to execute the Console.Write() method: Write the specified value Console window Console.WriteLine() method: Write the specified value to the console window, but add a newline character at the end of the output result where you want to break the line "\r \n” Related recommendations:The above is the detailed content of What does console.WriteLine mean in c language?. For more information, please follow other related articles on the PHP Chinese website!