Computer Science, asked by phaneendra58, 1 year ago

C++ program for calculating total marks & grade of the 60 students in the class

Answers

Answered by uttamtooldie27p3k9w2
29
#include <iostream.h>
void main()
{
int m1, m2, m3;
int total; char grade;
 cout << "\t\t Enter the marks in three subjects ";
cin >> m1 >> m2 >> m3;
 total = m1 + m2 + m3;
grade = (total >= 60)? 'A' :'B';
cout  << "\t\t Grade  is = > " << grade;
getch()


comment thanks if u like answer
Answered by monica789412
1

Cpp program for calculating Grade and Total Marks of the total strength of 60 students:

#include<iostream>

using namespace std;

int main(){

int m1, m2, m3;

   int i=1;

   while(i<=60){

       int total=0;

       cout<<"Marks of Student "<<" "<<i<<" in three subjects:";

       cin>>m1>>m2>>m3;

       total= m1+m2+m3;

       cout<<"Total Marks:"<<" "<<total<<endl;

       if(total>=280) {

           cout<<"Grade: A+"<<endl;

       }

      else if(total>=260) {

           cout<<"Grade: A"<<endl;

       }

       else if(total>=240) {

           cout<<"Grade: B+"<<endl;

       }

    else if(total>=220) {

           cout<<"Grade: B"<<endl;

       }

      else if(total>=200) {

           cout<<"Grade: C+"<<endl;

       }

       else if(total>=180){

           cout<<"Grade: C"<<endl;

       }

    else if(total>=160)  {

           cout<<"Grade: D+"<<endl;

       }

       else if(total>=140){

           cout<<"Grade: D"<<endl;

       }

       else if(total>=120) {

           cout<<"Grade: E"<<endl;

       }

       else{

          cout<<"Enter the valid Marks!"<<endl;

       }

       i++;      

   }

   return 0;

}

Similar questions