Question

In: Computer Science

Q: In a class there are ‘n’ students. All of them have appeared for the test....

Q: In a class there are ‘n’ students. All of them have appeared for the test. The Teacher who evaluated the
sheets wants to know average marks of the class. Write code to help the teacher find average
performance, use most appropriate data type/structure for storing marks.
           in c programing language ....

Solutions

Expert Solution

CODE:

#include <stdio.h>

int main(void) {
  int n;
  printf("Enter the number of students\n");
  scanf("%d",&n); //take input for number of students
  int a[n];//declare array to store marks 
  printf("Enter the marks of %d students\n",n);
  int sum=0;//declare sum variable to store sum of marks
  for(int i=0;i<n;i++){
    scanf("%d",&a[i]);//input the marks
    sum=sum+a[i];//calculate the sum
  }
  float avg=sum/n;//calculate the average
  printf("The average marks are %f",avg);//print the average
  return 0;
}

OUTPUT:


Related Solutions

INSTRUCTIONS: Attempt ALL questions There are 30 students in a class. Among them, 8 students are...
INSTRUCTIONS: Attempt ALL questions There are 30 students in a class. Among them, 8 students are learning both Audit and Tax. A total of 18 students are learning Audit. If every student is learning at least one language, how many students are learning Tax in total? Among a group of students, 50 played cricket, 50 played hockey and 40 played volley ball. 15 played both cricket and hockey, 20 played both hockey and volley ball, 15 played cricket and volley...
Suppose that there is a class of n students. Homework is to be returned to students,...
Suppose that there is a class of n students. Homework is to be returned to students, but the students’ homework assignments have been shuffled and are distributed at random to students. a) Calculate the probability that you get your own homework back. (I think it is 1/n) b) Suppose that I tell you that another student, Betty, got her own homework. Does this change the probability that you get your own homework, and if so what is the new probability?...
Suppose that there is a class of n students. Homework is to be returned to students,...
Suppose that there is a class of n students. Homework is to be returned to students, but the students’ homework assignments have been shuffled and are distributed at random to students. a) Calculate the probability that you get your own homework back. (I think it is 1/n) b) Suppose that I tell you that another student, Betty, got her own homework. Does this change the probability that you get your own homework, and if so what is the new probability?...
In a psychology class, 59 students have a mean score of 98 on a test. Then...
In a psychology class, 59 students have a mean score of 98 on a test. Then 16 more students take the test and their mean score is 62.8. What is the mean score of all of these students together? Round to one decimal place. mean of the scores of all the students = 57 randomly selected students were asked how many siblings were in their family. Let X represent the number of pairs of siblings in the student's family. The...
In a class of 25 students, 24 of them took an assignment in class and 1...
In a class of 25 students, 24 of them took an assignment in class and 1 student took a make-up assignment the following day. The professor graded the first batch of 24 assignments and found an average score of 74 points with a standard deviation of 8.9 points. The student who took the make-up the following day scored 64 points on the assignment. (a) Does the new student's score increase or decrease the average score? how (b) What is the...
The average height for a student in a class with n = 60 students is a...
The average height for a student in a class with n = 60 students is a random variable with an average height of 180 cm and standard deviation σ = 10. The individual heights which make up that average are i.i.d. (1) use Chebyshev’s inequality to find an upper bound for the probability that the average of the class (obtained from the individual student heights) is greater than 200cm. (2) Use Chebyshev’s inequality to upper bound the probability that the...
A: You recently took a statistics class in a large class with n = 500 students....
A: You recently took a statistics class in a large class with n = 500 students. The instructor tells the class that the scores were Normally distributed, with a mean of 7 2 (out of 100 ) and a standard deviation of 8 , but when you talk to other students in the class, you find out that more than 30 students have scores below 45 . That violates which rule for the Normal distribution? the 30–60–90 rule the 1–2–3...
Three metal spheres (A, B, C) all have the same charge +Q on them. The spheres...
Three metal spheres (A, B, C) all have the same charge +Q on them. The spheres have radii of RA = 1m, RB = 2m, and RC = 4m respectively. Rank the magnitude of the electric field at a distance r = 3m in each case. a. EA < EB < EC b. EC < (EA = EB) c. EA = EB = EC d. EC < EB < EA
A professor has kept track of test scores for students who have attended every class and...
A professor has kept track of test scores for students who have attended every class and for students who have missed one or more classes. below are scores collected so far. perfect: 80,86,85,84,81,92,77,87,82,90,79,82,72,88,82 missed 1+:61,80,65,64,74,78,62,73,58,72,67,71,70,71,66 1. Evaluate the assumptions of normality and homoscedasticity 2. conduct a statistical test to assess if exam scores are different between perfect attenders and those who have missed class 3. What is the meaning of the 95% confidence interval given from the R code. What...
A math department gives all college algebra students a test to test rather or not students...
A math department gives all college algebra students a test to test rather or not students taking college algebra on site perform better on Final than students that take class completely online. The Math department gathers random samples of 40 on-site students (Students who take class in the classroom) and 35 online students. The test score for each student in the random sample is determined. The mean score for the on-site students is 75, with a standard deviation of 12....
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT