answersLogoWhite

0


Best Answer

#include<stdio.h>

#include<conio.h>

void main()

{

int n, i,a[100],sum=0;

float avg;

printf("Enter number of students");

scanf("%d",&n);

printf("Enter the marks score by students one by one");

for(i=0;i<n;i++)

{

scanf("%d",&a[i]);

sum=sum+a[i];

}

avg=sum/n;

printf("The average is %f", avg);

getch();

}

User Avatar

Wiki User

12y ago
This answer is:
User Avatar
More answers
User Avatar

Wiki User

9y ago

You can use the accumulate function to determine the sum of elements in any data container, including an array (provided the container type supports binary operator+). For example:

std::array<int, 6> a {5,9,2,3,4,1};

int sum = std::accumulate (a.begin(); a.end());

int avg = sum / a.size();

assert (sum==24);

assert (avg==4);

This answer is:
User Avatar

User Avatar

Wiki User

11y ago

#include<stdio.h.

int l,m.n.o.p.r.s

main()

{

print f("enter ten students;");

print f("enter x<30=u;);

scan f("l,x<30=u);

print f("input x>29 but less that 40=e;");

scan f("m,x>29 but less than 40=e");

print f("enter x>39 but less than 50=d;")

scan f("n,x>39 but less than 50=d);

print f("input x>49 but less than 60=c;");

scan f("o,x>49 but less than 60,");

print f(" input x>59 but less that 70=b;");

scan f("p,x>59 but less than 70;");

print f("enter x>69 to 100=a;");

scan f ("q,x>69 to 100;");

/*input number of subjects*/

print f ("enter four subjects;");

scan f("%d," &r);

/*grade the results of each students per subject*/

s=graded results of each student;

print f("grade results for a up to u of each student;");

return 0

}

This answer is:
User Avatar

User Avatar

Wiki User

10y ago
  1. Declare a float variable for storing the sum of the three marks, and set it to zero.
  2. Make a loop that iterates three times. A for loop would suffice.
  3. In that loop, prompt the user to enter a mark. If you're not worried about memory vulnerabilities then simply using printf and scanf would do. Add the entered value to the float that you declared for storing the sum.
  4. After the loop is complete, divide that sum by three.
  5. Output the result (again, printf would probably suffice).

So a quick hen-scratch (untested, and I haven't done any real C Programming in years):

#include

int main void(int argc, char *argv[]){

float tally = 0, mark;

int n, numStudents = 3;

for(n = 0; n < numStudents; n++){

printf("Please enter the mark for student #%i: ", n + 1);

scanf("%f", &mark);

tally += mark;

}

printf("The average mark of the %i students is %f\n", tally / numStudents);

return 0;

}

This answer is:
User Avatar

User Avatar

Wiki User

9y ago

You can use the accumulate function to determine the sum of elements in any data container, including an array (provided the container type supports binary operator+). For example:

std::array a {5,9,2,3,4,1};


int sum = std::accumulate (a.begin(); a.end());

int avg = sum / a.size();


assert (sum==24);

assert (avg==4);


This answer is:
User Avatar

User Avatar

Wiki User

8y ago

To write a C program to find the total and average for seven subjects, sum the seven subjects to get the total. Divide the total by seven to get the average.

This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: How do you write a c program that computes the results of ten students for any given four subjects grading their results from a to you?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

How do you write a c program that computes results of 10 students for any given 4 subjects grading their results from a A to U?

ghfj


What is Moshal Scholarship Program?

Moshal Scholarship Program provides scholarships to disadvantaged students in Israel and South Africa. The program offers full scholarships to students in a select range of subjects.


C program to print mark sheet of 5 subjects and the number of students is user input?

hhh


What is grading program?

An ungraded school is a school that does not formally classify the students by the traditional grade levels. Instead, teachers evaluate each individual student.


Which group of people is the TAMS educational program aimed at?

The TAMS or Texas Academy of Mathematics and Science educational program is aimed at high school aged Texas students with good achievements. Those students should be interested in subjects of mathematics and science.


What is block programming?

it is a program that computes whit aerodynamic serious consequences with full winded service that control a component


What is the answers to stars suite?

Stars suite is an online program for US students their curriculum includes most subjects including Language arts, mathematics, science, social sciences, world languages and further elective subjects. You cannot gain the answers to the questions in advance and have to work through the program online.


Who is the egg grading org?

USDA is the governing body of the grademark. AMS ( Agricultural Marketing Service ) has a voluntary grading program for eggs in the Agricultural Marketing Act of 1946.


Defination of Bachelor of Commerce {BCom}?

B.Com, or Bachelor of Commerce, is a three-year undergraduate degree program in commerce and related subjects. It is designed to provide students with knowledge and skills in the areas of business, finance, accounting, economics, and management. The program is designed to help students develop the necessary skills for a successful career in the business world.


Defination of Bachelor of Commerce {Bcom}?

BCom, or Bachelor of Commerce, is a three-year undergraduate degree program in commerce and related subjects. It is designed to provide students with knowledge and skills in the areas of business, finance, accounting, economics, and management. The program is designed to help students develop the necessary skills for a successful career in the business world.


When was Victorian Students' Aid Program created?

Victorian Students' Aid Program was created in 2005.


Why do people like the pathways program at John Abbott College it is such a bad program?

It's a bad program for good students, it's a good program for evil students