5 10 20 30 40 50
30
#include <iostream>
using namespace std;
void question1_array_average() {
int marks[] = {85, 90, 78, 92, 88};
int total = 0;
int size = 5;
for(int i = 0; i < size; i++) {
total = total + marks[i];
}
float average = (float)total / size;
cout << "Average marks: " << average << endl;
}
#include <iostream>
using namespace std;
void question1_array_average() {
int marks[] = {85, 90, 78, 92, 88};
int total = 0;
int size = 5;
for(int i = 0; i < size; i++) {
total = total + marks[i];
}
float average = (float)total / size;
cout << "Average marks: " << average << endl;
}