Tuesday 8 January 2013

Let Us C Chapter 1 Problem No:H-c


#include<iostream.h>
#include<conio.h>
void main()
{
int a,b,c,d,e; // inputs the subject numbers note that the max marks is 100
cin>>a>>b>>c>>d>>e;
// basically the aggregates marks are the avarage marks
float per;int ag; // ag--->aggreagate
ag=(a+b+c+d+e)/5;
per=((a+b+c+d+e)/500.0)*100;
cout<<"This is the the total marks: "<<(a+b+c+d+e)<<endl;
cout<<"This is the aggregate: "<<ag<<endl;
cout<<"This is the percentage: "<<per<<endl;
}

No comments:

Post a Comment

Comments please: