Answer to Question #263867 in C for Hari

Question #263867

Computer Programming teacher conducts test for 20 marks for 10 students. Teacher wants to know the average marks scored by the students.



Following are requirements to solve the problem



Teacher should have capture the marks scored by the student.



Teacher should compute the average marks scored by the students.



Teacher should display the average marks scored by the students.



Computer Programming teacher conducts test for 20 marks for 10 students. Teacher wants to know the average marks scored by the students.




1
Expert's answer
2021-11-10T11:27:55-0500
#include<stdio.h>
int main(){
	int marks[10][20];
	int i;
	int j;
	int average[10];
	int sum = 0;
	for(i=0; i<10; i++){
		printf("\nEnter marks for student %d", (i+1));
		for(j=0; j<20; j++){
			printf("\nEnter marks:  %d\n", (j+1));
			scanf("%d", &marks[i][j]);
			sum += marks[i][j];
		}
		average[i] = sum /20;
	}
	int k;
	for(k=0; k<10; k++){
		printf("Student %d: Average is %d\n", (k+1), average[k]);
	}
}

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 the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS