Answer to Question #19601 in C++ for Akshara Sharma

Question #19601
write a c++ program that accepts marks in 5 subjects and outputs average marks.
1
Expert's answer
2012-11-27T09:54:13-0500
#include <iostream>
#include <stdlib.h>

using namespace std;

int main()
{
int n;
int m,a=0;
cout<<"please enter marks"<<endl;
for (int i=1;i<=5;i++)
{ cin>>n;
a=a+n;}
m=a/5;
cout<<endl<<"average="<<m<<endl;
&
& system("PAUSE");
& 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
APPROVED BY CLIENTS