Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Adding new line to console output

Tags:

vb.net

In console application we write the statement as

Console.WriteLine("the addition is {0}",i)

it gives the output

addition is 50

Now my question is: I want the answer to appear like this:

addition is

50

How I will assign the output to the next line?

like image 297
mandar Avatar asked Dec 10 '22 14:12

mandar


2 Answers

Console.WriteLine("The addition is, {0} {1}", _
    Environment.NewLine, i)
like image 155
dbasnett Avatar answered Dec 19 '22 12:12

dbasnett


I agree with rdkleine. Punctuation in your question would be very helpful. But, I'm going to step out on a limb and assume you mean, how can I add a line break to the output using Console.WriteLine.

Use vbcrlf to generate a line break.


Console.WriteLine("The addition is" & vbCrLf & "{0}", i)
like image 27
Josaph Avatar answered Dec 19 '22 12:12

Josaph