Problem Statement:
If the marks obtained by a student in five different subjects
are input through the keyboard, find out the aggregate marks
and percentage marks obtained by the student. Assume that
the maximum marks that can be obtained by a student in each
subject is 100.
are input through the keyboard, find out the aggregate marks
and percentage marks obtained by the student. Assume that
the maximum marks that can be obtained by a student in each
subject is 100.
Solution:
#include <iostream>#include <conio.h>using namespace std;int main(){ float s1,s2,s3,s4,s5,tmark,per; char a; cout<< "Enter Students marks in five different sunjects separated with semicolon(:)\n"; cin >>s1>>a>>s2>>a>>s3>>a>>s4>>a>>s5; tmark=s1+s2+s3+s4+s5; per=tmark/500*100; cout<<"\nAggregate marks="<<tmark <<"\npersentage marks="<<per<<'\n'; getch();
}
No comments:
Post a Comment