Answer to Question #207140 in C++ for Aroosha ch

Question #207140

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


1
Expert's answer
2021-06-15T01:29:33-0400


#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!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog