Monday 26 August 2013

Latest If and else condition in C#

Que:-Write a program of If ,if else and else condition????




Ans:- using System;
using System.Collections.Generic;
using System.Text;

namespace codeforevenorodd
{
    class program
    {
       
       

            static void Main(string[] args)
            {
                int totalmarks = 59;
                if (totalmarks > 80)
                {
                    Console.WriteLine("got higher");
                }
                else if (totalmarks> 60)
                {
                    Console.WriteLine("Got first class");
                }
                else if (totalmarks > 40)
                {
                    Console.WriteLine("just pass only");
                }
                else
                {
                    Console.WriteLine("failed");
                }
                Console.ReadLine();
            }
        }
    }

     

       
      
       
   
 

No comments:

Post a Comment