How do you use the WriteLine method in VB?

In VB, the WriteLine method is used to write specified data to the standard output stream and adds a new line at the end. Here is an example demonstrating how to use the WriteLine method in VB:

Dim name As String = "John"
Dim age As Integer = 30

Console.WriteLine("Name: " & name)
Console.WriteLine("Age: " & age)

In the given example, we first define a string variable named name and an integer variable named age. We then use the WriteLine method to write the values of these two variables to the standard output stream, with a new line added at the end of each line. The final output will be:

Name: John
Age: 30
Leave a Reply 0

Your email address will not be published. Required fields are marked *