Sunday, 3 December 2017

C# Program to Illustrate the use of Conditional Logical Operator


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:


















100+ Best Home Decoration Ideas For Christmas Day 2019 To Make Home Beautiful

Best gifts for Christmas Day | Greeting cards for Christmas Day | Gift your children a new gift on Christmas day This Christmas d...