In this tutorial you will understand how to create simple vb.net console application.
Look at the code below
Module Module1 Sub Main() Console.WriteLine("hi this is my first console application in vb.net") Console.Write("hi ") Dim abc As String Console.WriteLine("write line that i'll print on next line") abc = Console.ReadLine() Console.WriteLine(abc) Console.Read() End Sub End Module
In VB you don’t need to put semicolon to indicate end of line.
The following indicates that when you select console application that is displayed on your screen i.e
…..//YOUR CODE HERE\\……
console.WriteLine or console.Write
The only difference between console.WriteLine and console.Write is console.Write doesn’t shift cursor to next line after printing
amd WriteLine passes cursor to next line after printing.
In Visual Studio start typing console it will suggest you console and further.
Dim abc As String
in vb.net variables are declared in this manner.
if you want to use integer then write Dim d As integer
you are using variable abc as string.
abc = Console.ReadLine()
console.ReadLine() function reads whole line.
so in this program we are storing whole line in string abc
console.Read() works in same as getchar() in c
see the output