Home »
MCQs »
C# MCQs
What is the difference between Console.Write() and Console.WriteLine() methods in C#?
35. What is the difference between Console.Write() and Console.WriteLine() methods in C#?
- Write() writes a single character while Console.WriteLine() writes a complete line
- Write() writes the data on the console without printing a newline while Console.WriteLine() writes the data on the console along with printing a newline
- ToFloat(Console.ReadLine());
- Write() writes the string on the console while Console.WriteLine() writes the string as well as values of the variables on the console
- Both can be used for the same purpose
Answer: B) Write() writes the data on the console without printing a newline while Console.WriteLine() writes the data on the console along with printing a newline
Explanation:
The only difference between the Console.Write() and Console.WriteLine() is that the Console.Write() is used to write data without printing the new line, while Console.WriteLine() is used to write data along with printing the new line.