Best writers. Best papers. Let professionals take care of your academic papers

Order a similar paper and get 15% discount on your first order with us
Use the following coupon "FIRST15"
ORDER NOW

I am trying to change the code i wrote to allow input from n students

I am trying to change the code i wrote to allow input from n students

instead of a set number. i have identifiy the n and interger students but it only reads the first student
below is the code and the what the output looks like
#include <stdio.h>
int main ()
{
/* variable definition: */
char StudentName[100];
float ExamValue, Sum, Avg;
int students,exams,n;
// Loop through n Students
for (; students <n ; students++)
{
// reset Sum to 0
Sum .0;
printf(“Enter Student Name \n”);
scanf(“%s”, StudentName);
// Nested Loop for Exams
for (; exams < 3; 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;

}

Background image of page 1
 
Looking for a Similar Assignment? Order now and Get 10% Discount! Use Coupon Code "Newclient"