Mega Code Archive

 
Categories / VB.Net Tutorial / Language Basics
 

Convert what you type to value type

Module Module1     Sub Main()         Dim intInput As Integer         Console.WriteLine("Enter a temperature...")         intInput = Val(Console.ReadLine())         If intInput > 75 Then             Console.WriteLine("Too hot!")         ElseIf intInput < 55 Then             Console.WriteLine("Too cold!")         Else             Console.WriteLine("Just right!")         End If     End Sub End Module Enter a temperature... 12 Too cold!