C CodeThe following is the C Code that will compile in execute
C Code<br/>The following is the C Code that will compile in execute
in the online compilers.
// C code
// This program will calculate the average of 3 exams for 5 students.
// Developer: Faculty CMIS102
// Date: Jan 31, XXXX
#include
int main ()
{
/* variable definition: */
char StudentName[100];
float ExamValue, Sum, Avg;
int students,exams;
// Loop through 5 Students
for (students=0; students {
// reset Sum to 0
Sum =0.0;
printf(“Enter Student Name \n”);
scanf(“%s”, StudentName);
// Nested Loop for Exams
for (exams=0; exams {
printf (“Enter exam grade: \n”);
scanf(“%f”, &ExamValue);
Sum += ExamValue;
}
Avg = Sum/3.0;
printf( “Average for %s is %f\n”,StudentName,Avg);
}
return 0;
}
What is the line of code doing?
char StudentName[100];
(Hint: We haven’t covered arrays, but a String can be thought of as an array of characters) ?