76 804
Assignments Done
Successfully Done
In June 2019

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!


No comments. Be first!

Leave a comment

Ask Your question

Privacy policy Terms and Conditions