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").
Example Code
using System; // Importing the System namespace to use Console functionalities
// Main class of the program
class Program
{
// Main method where the program execution begins
static void Main()
{
// Declaring a variable to store the user's age
int age;
// Asking the user to enter their age and reading the input
Console.Write("Please enter your age: ");
age = Convert.ToInt32(Console.ReadLine());
// Printing the response with the age entered by the user
Console.WriteLine("You look younger than {0}", age);
}
}