write an algorithm to calculate the sum and average score of students in a class
Answers
Answered by
6
Step 1 Ask for the mark sheet from the teacher of each student
Step 2 Take a Sheet of paper and write all the marks in it
Step 3 Add all the marks
Step 4 Divide the sum of the marks by the total numbers of students who have the test
Step 5 Your algorithm is ready
Step 2 Take a Sheet of paper and write all the marks in it
Step 3 Add all the marks
Step 4 Divide the sum of the marks by the total numbers of students who have the test
Step 5 Your algorithm is ready
Answered by
3
int main()
{
int arr[100],s=0,i;
cin>>size;
for(int i=0;i<size;i++)
cin>>arr[i];
}
for( i=0;i<size;i++)
s=s+arr[i];
}
cout<<"total sum"<<s;
cout<<"average"<<s/(size);
Similar questions