Write a C++ program which take C++ Programming course marks of 10 students and find the average marks.
Answers
Answered by
3
Answer: as explanation is given below
Explanation:
Here we will consider an array with value of 10 students marks. The marks will be stored in the ten indexes of an array. Then sum of them will be divided by 10.
The code
using namespace std
#include<iostream>
void main()
{
int arr[10], i.j,sum=0;
for(i=1;i<=10;i++)
{
cout<<"enter the marks of student <<i;
cin>>arr[i]
sum=+arr[i];
}
int avg=sum/10;
cout<< " Average is"<<avg;
}
Hence after the ten iterations of the for loop the sum value will be updated and get added to the final value of summation of all marks and hence average will be found out.
Similar questions