Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Writing multiple sentences on one line

Tags:

vb.net

I want my program to write the following to to the console:

The volume of your Right Rectangular Prism is: * Cm^3

But I don't know how to make it write anything after I specify the "& volume" in the call to the WriteLine method. Is there any way to actually do this?

Here is my code for that line:

Console.Write("The volume of your right rectangular prism is: " & volume):("Cm^3")
like image 433
Agent531_C Avatar asked Mar 21 '23 15:03

Agent531_C


2 Answers

Looks like a line of C#?

You can use something like:

Console.Write("The volume of your right rectangular prism is: ");
Console.WriteLine(volume & " Cm^3");
like image 120
Big Boss Avatar answered Mar 28 '23 14:03

Big Boss


Try it this way:

Console.Write("The volume of your right rectangular prism is: " & volume & " whatever else you want to say")

In fact you could keep going... the basic concept is end your text then do a &, then add the variable. If you need more you can always repeat it the same way.

like image 23
logixologist Avatar answered Mar 28 '23 12:03

logixologist