Answer to Question #43764 in C++ for abhishek

Question #43764
w a p in c++that accept marks in 5 subject and output its average marks
1
Expert's answer
2014-07-04T10:55:21-0400
#include <stdio.h>
#include <tchar.h>
#include <iostream>
using namespace std;
int main() {
const int n = 5;
int arr[n];
int sum = 0;
for (int i = 0; i < n; i++) {
cout<<"Input mark in "<<i+1<<" subject - ";
cin>>arr[i];
sum+=arr[i];
cout<<endl;
}
cout<<"Average - "<<(double)sum/n<<endl;
system("pause");
}

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