Interviews10 answers
What is the difference between System.console.WriteLine() and System.console.Write() function?example?
10 Answers
console.writeLine() , after print of statment, this function carry next statement to next line:
while console.write() only print statement
Amit SwamiPosted Oct 14, 2017, 4:51 AM EDT
writeline () makes ur control move to the next line wereas write() makes ur control to stay on the sameline
Ragni KesarwaniPosted Sep 23, 2016, 10:41 AM EDT
writeline () makes ur control move to the next line wereas write() makes ur control to stay on the sameline
Ashish SrivastavaPosted Jul 8, 2016, 9:52 AM EDT
writeline () makes ur control move to the next line wereas write() makes ur control to stay on the sameline
Pankaj Kumar ChoudharyPosted Aug 29, 2015, 8:19 AM EDT
consol.WriteLine() change the line after print the given text but consol.Write() do not change line.
Rahul PrajapatPosted May 27, 2015, 4:54 PM EDT
system.console.writeline() and System.console.Write() both are used as output statements in c# but th basic difference is writeline () makes ur control move to the next line wereas write() makes ur control to stay on the sameline
Lakshmi PriyaPosted Dec 1, 2014, 7:11 AM EST
Console.Write
puts text on the console window. Getting started with the Console can be confusing. We learn the difference between Console.Write and Console.WriteLine. We decide which one to choose. We even use them together.
Example
The Console.Write method requires the System namespace to be included at the top to get the fully qualified name. The Write method does not append a newline to the end of the Console.
Also, if you are printing a string that already has a newline, you can use Console.Write for an entire line. And when you call WriteLine with no parameters, it only writes a newline.
using System;
class Program
{
static void Main()
{
Console.Write("One "); // <-- This writes the word.
Console.Write("Two "); // <-- This is on the same line.
Console.Write("Three"); // <-- Also on the same line.
Console.WriteLine(); // <-- This writes a newline.
Console.WriteLine("Four"); // <-- This is on the next line.
}
}
Result is :--
One Two Three
Four
Ashu BahlPosted Nov 18, 2014, 7:43 PM EST
i got only single difference between console.writeLine() break new line, no worry for new line.
Console.Write worry about the new line
Joginder BangerPosted Nov 10, 2014, 11:47 PM EST
System.console.WriteLine() =break new line
and System.console.Write() =not break new line
istekhar ahmadPosted Oct 20, 2014, 5:24 AM EDT
Both the function enable you to print information on the screen in the same manner, but with a small difference of both.
System.console.WriteLine()prints the information on screen and goes to next line .However,
System.console.Write()print the information on the screen ,but does not go to next line.only one print the current line.
Example:
using System;
using System.Collections.Generic;
using System.Text;
namespace ConsoleApplication4
{
class Program
{
static void Main(string[] args)
{
System.Console.WriteLine("Welcome to Console C#");
System.Console.WriteLine("Difference between console");
System.Console.Write("Hello C# Corner\t");
System.Console.Write("How are you C# Corner");
Console.ReadLine();
}
}
}
Krishna Rajput SinghPosted Jul 16, 2014, 3:02 AM EDT





