C++ Programming Blog

 
 
 

Image

 #include<iostream.h>
 #include<conio.h>

 main( )
    {
       clrscr( );

       int marks;
       char grade;

       cout<<\"\\n Enter your Marks = \";
       cin>>marks;

       if(marks>=80 && marks<=100)
      grade=\'A\';

       else if(marks>=70 && marks<80)
      grade=\'B\';

       else if(marks>=60 && marks<70)
      grade=\'C\';

       else if(marks>=50 && marks<60)
      grade=\'D\';

       else
      grade=\'F\';

       cout<<\"\\n Your Grade is = \"<<grade<<endl;

       getch( );
       return 0;
    }