programming-examples/c-sharp/Functions/C# Program to Illustrate the use of Conditional Logical Operator.cs

20 lines
430 B
C#
Raw Normal View History

2019-11-15 12:59:38 +01:00
/*
* C# Program to Illustrate the use of Conditional Logical Operator
*/
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();
}
}
/*
Enter the Age : 10
Adult : false