Preview:
//Nested If Construct or Statements

static void Main(string[] args)

        {

            int Salary, Service;

            Console.Write("Enter Yrs Of Service:-");
            Service = Convert.ToInt32(Console.ReadLine());

 

            Console.Write("Enter Salary:-");
            Salary = Convert.ToInt32(Console.ReadLine());

 

            if (Service < 5)
            {
                if (Salary < 500)
                {
                    Console.WriteLine("Provided Bonus:-> 100");
                }
                else
                {
                    Console.WriteLine("Provided Bonus:-> 200");
                }
            }
            else
            {
                Console.WriteLine("Provided Bonus:-> 700");
            }
            Console.ReadLine();
        }
//=========================================
//Switch .. Case Construct or Statements

static void Main(string[] args)
        {
            int Day;
            Console.WriteLine("Enter Your Choice:-");
            Day = Convert.ToInt32(Console.ReadLine());

            switch (Day)
            {
                case 1:
                    Console.WriteLine("Sunday");
                    break;
                case 2:
                    Console.WriteLine("Monday");
                    break;
                case 3:
                    Console.WriteLine("Tuesday");
                    break;
                case 4:
                    Console.WriteLine("Wednesday");
                    break;
                case 5:
                    Console.WriteLine("Thursday");
                    break;
                case 6:
                    Console.WriteLine("Friday");
                    break;
                case 7:
                    Console.WriteLine("Saturday");
                    break;
                default:
                    Console.WriteLine("Enter a Number between 1 to 7");
                    break;
            }
            Console.ReadLine();
        }

//==================================
//The while loop


static void Main(string[] args)
        {
            int num = 1;
            //Console.Write("Enter Number:-");
            //num = Convert.ToInt32(Console.ReadLine());

            while (num <= 11)
            {
                   if ((num % 2) == 0)
                   {
                         Console.WriteLine(+num);
                   }
              
              num = num + 1;
            }
            Console.ReadLine();

        }

//==================================
//The "Do-While" Loop

downloadDownload PNG downloadDownload JPEG downloadDownload SVG

Tip: You can change the style, width & colours of the snippet with the inspect tool before clicking Download!

Click to optimize width for Twitter