The world’s Largest Sharp Brain Virtual Experts Marketplace Just a click Away
Levels Tought:
Elementary,Middle School,High School,College,University,PHD
| Teaching Since: | Apr 2017 |
| Last Sign in: | 103 Weeks Ago, 3 Days Ago |
| Questions Answered: | 4870 |
| Tutorials Posted: | 4863 |
MBA IT, Mater in Science and Technology
Devry
Jul-1996 - Jul-2000
Professor
Devry University
Mar-2010 - Oct-2016
Please help! I cannot figure this code out at all! I keep getting a Runtime error!
Â
Modify the code to be able to input an undetermined number of students. You will still only have 3 exams for each student. Support your experimentation with screen captures of executing the new code
Â
#include <stdio.h>
int main ()
{
 /* variable definition: */
 char StudentName[100];
 float ExamValue, Sum, Avg;
 int students,exams;
  // Loop through 5 Students
 for (students=0; students <5 ; students++)
 {
    // reset Sum to 0
    Sum =0.0;Â
    printf("Enter Student Name n");
    scanf("%s", StudentName); Â
    // Nested Loop for Exams
   for (exams=0; exams < 3; exams++)
   {
       printf ("Enter exam grade: n");
       scanf("%f", &ExamValue);
       Sum += ExamValue;
   } Â
   Avg = Sum/3.0;
   printf( "Average for %s is %fn",StudentName,Avg);
 }
 return 0;
}