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

Answer to Question #3349 in C++ for mukunda

Question #3349
Write a program to calculate the average marks of a student (Declare variables as global)?
Expert's answer
#include <iostream>
using namespace std;

int marks[] = { 68, 34, 56, 80 };
const int marks_size = sizeof(marks) / sizeof(int);

int main()
{
double sum = 0;
for (int i = 0; i < marks_size; ++i)
& sum += marks[i];
double average = sum / marks_size;

cout << "Average mark is " << average << 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