Question #207140

in c++ 1.      Write a code which accept marks of three subjects as argument and return CGPA on the basis of marks.


Expert's answer



#include <iostream>


using namespace std;
int getCGPA(int m1,int m2,int m3){
    int sum=m1+m2+m3;
    int cgpa=sum/3;
    return cgpa;
}
int main()
{
    int a,b,c;
    cout<<"Enter the marks of the three subjects:\n";
    cin>>a>>b>>c;
    cout<<"CGPA is: "<<getCGPA(a,b,c);
    return 0;
}

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

LATEST TUTORIALS
APPROVED BY CLIENTS