Age Learn programming Visual Basic (VB.net)

Lesson:

First contact with Visual Basic (VB.net)


Exercise:

Age


Objetive:

Write a Visual Basic (VB.net) program to ask the user for their age (e.g. 20) and respond with something like "You look younger than 20" (the age entered by the user should be displayed in place of "20").


Code:

Imports System
Public Class exercise11
    Public Shared Sub Main()
        Dim age As Integer
        Console.Write("Enter a age ")
        age = Convert.ToInt32(Console.ReadLine())
        Console.Write("You look younger than {0} ", age)
    End Sub
End Class

Juan A. Ripoll - Systems Tutorials and Programming Courses ©  All rights reserved.  Legal Conditions.