66 916
Assignments Done
99,1%
Successfully Done
In October 2018

Answer to Question #14272 in C++ for yantra

Question #14272
c++ program to take average of 6 subjects
Expert's answer
#include <iostream>

using std::cin;

int main() {
int i, n;
double temp, sum=0.0;
cin >> n;

for (i=0; i<n; ++i) {
std::cout << "Enter the mark of subject "<<(i+1) << std::endl;
cin >> temp;
sum += temp;
}

std::cout << (sum / n) << std::endl;

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

Leave a comment

Ask Your question

Submit
Privacy policy Terms and Conditions