Write a C program to compute the average marks in a subject of all the students in a class.
Set up a loop; if you know how many students, you can do a for loop, otherwise do a while loop and use a score of -1 to end the loop.
Then add up all the scores and divide by the number of scores. You'll want to make sure at least one score was input to avoid a divide by 0 error.
int n, i,array,s=0;
printf("Enter no. of students");
printf("Enter the marks of students one by one");
only showing the basics , its an alternative which dosen't waste memory space much .
printf("how many students in the class:");
by Naveed Ahmed3 years ago
How to write a simple C Program for calculating a sum of integers?In C Programming using C++ Environment, I want to calculate the sum of some continuous integers, say 1 to 10. I have studies some loop structures like...
by sudeepbanerjee7 years ago
write a c program to input the number and print the even number
by wonderingwoolley6 years ago
What was your worst subject in school?Mine was math! It just doesn't compute in my head!
by Teri Silver2 months ago
Video: Not YouTube or Vimeo but my subject, who set it to me and I have clips in my computer. Can I upload it from my notebook, doesn't see to let me and I don't have these videos on YouTube or Vimeo. How do...
by Rahul Parashar4 years ago
I was wondering how much people actually earn on HubPages through HubPages ads program? Does it produces better results than AdSense? How much hubs and tgime does it take to start earning? Yeah, I know, so many...
by navneetjha5 years ago
What is the average CPM on hub page ad program?My average CPM is quite low as compared to other even after writing 62 hubs. Its was about $1.60 for last month. What are your experiences?
Copyright © 2018 HubPages Inc. and respective owners.
Other product and company names shown may be trademarks of their respective owners.
HubPages® is a registered Service Mark of HubPages, Inc.
HubPages and Hubbers (authors) may earn revenue on this page based on affiliate relationships and advertisements with partners including Amazon, Google, and others.