use of if statement in C#

 //Program is constructed under Aryan Computers, Barshi 

For Example: Write a program to demonstrate use of if statement.

using System;

using System.Collections.Generic;

using System.Linq;

using System.Text;

 

namespace ConsoleApplication1

{

class Program

    {

static void Main(string[] args)

        {

int a;

Console.WriteLine("Enter Less than 20 Number");

            a = Convert.ToInt32(System.Console.ReadLine());

if (a < 20)

            {

Console.WriteLine("You Entered right value");

Console.ReadLine();

            }

 

        }

    }

}

Output:

Comments

Popular posts from this blog

simple program C#

Regular Expression Validator Control in asp.net

two dimension array in C#