+ 2

I don't really understand differences between Console.Write and Console.WriteLine

Printing to the screen

26th Dec 2016, 9:41 AM
Elegis Sossou
Elegis Sossou - avatar
5 Answers
+ 5
Both of them displays output, but one write the output on a new line. Try this: Console.Write("this is text 1"); Console.Write("This is text2"); Console.WriteLine("This is text3");
26th Dec 2016, 9:56 AM
Wen Qin
Wen Qin - avatar
+ 1
jump a line or go to the next line ?
26th Dec 2016, 9:44 AM
Elegis Sossou
Elegis Sossou - avatar
+ 1
next Line sorry :)
26th Dec 2016, 9:45 AM
Hickacou
Hickacou - avatar
0
Console.write write your texte, but writeLine write your texte and jump a Line.
26th Dec 2016, 9:43 AM
Hickacou
Hickacou - avatar
0
Consider this: //Output = 45 using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace YourName { class Program { static void Main(string[] args) { int x = 4; int y = 5; Console.Write(x); Console.Write(y); } } } While this output: 4 5 using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace YourName { class Program { static void Main(string[] args) { int x = 4; int y = 5; Console.WriteLine(x); Console.WriteLine(y); } } }
27th Dec 2016, 10:29 AM
Ajani AbdulGaniy A
Ajani AbdulGaniy A - avatar