Code:
using System;
public class Program
{
static void Main()
{
int age;
Console.WriteLine("Enter the Age :");
age=int.Parse(Console.ReadLine());
bool adult = age >= 18 ? true : false;
Console.WriteLine("Adult : {0}", adult);
Console.Read();
}
}
Output:
Enter the Age : 10
Adult : false
More C# Programs: