Age Learn programming C#

Lesson:

First contact with C# Sharp


Exercise:

Age


Objetive:

Write a C# 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:

using System;
public class exercise11
{
    public static void Main()
    {
        int age;
        Console.Write("Enter a age ");
        age = Convert.ToInt32(Console.ReadLine());
        Console.Write("You look younger than {0} ", age);
    }
}

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