fork download
  1. #include <stdio.h>
  2. int main ()
  3. {
  4. /* variable definition: */
  5. char StudentName[100];
  6. float ExamValue, Sum, Avg;
  7. int students,exams;
  8. // Initialize Sum
  9. Set Sum = 0.0;
  10. // Loop through 5 Students
  11. for (students=0; students <5 ; students++)
  12. {
  13. printf("Enter Student Name \n");
  14. scanf("%s", StudentName);
  15. // Nested Loop for Exams
  16. for (exams=0; exams < 3; exams++)
  17. {
  18. printf ("Enter exam grade: \n");
  19. scanf("%f", &ExamValue);
  20. Sum += ExamValue;
  21. }
  22. Avg = Sum/3.0;
  23. printf( "Average for %s is %f\n",StudentName,Avg);
  24. }
  25. return 0;
  26. }
  27.  
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.c: In function ‘main’:
prog.c:9:1: error: unknown type name ‘Set’
 Set Sum = 0.0;
 ^~~
prog.c:9:5: error: conflicting types for ‘Sum’
 Set Sum = 0.0;
     ^~~
prog.c:6:19: note: previous declaration of ‘Sum’ was here
  float ExamValue, Sum, Avg;
                   ^~~
stdout
Standard output is empty