fork download
  1.  
  2. #include <stdio.h>
  3. #include <stdlib.h>
  4.  
  5.  
  6. int main ()
  7. {
  8. /* variable definition: */
  9.  
  10. float Sum, Avg, NewSum, NewAvg;
  11. // Loop through 2 Students
  12. for (students=0; students <2 ; students++)
  13. {
  14. // reset Sum to 0
  15. Sum = 4.0;
  16. Avg = Sum/2.0;
  17. NewSum += 80 + 90 + 100;
  18. NewAvg = NewSum/3;
  19. printf( "Average \n",Sum);
  20. printf( "New Average \n",NewAvg);
  21.  
  22. }
  23. return 0;
  24. }
  25.  
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.c: In function ‘main’:
prog.c:12:6: error: ‘students’ undeclared (first use in this function)
 for (students=0; students <2 ; students++)
      ^~~~~~~~
prog.c:12:6: note: each undeclared identifier is reported only once for each function it appears in
prog.c:19:9: warning: too many arguments for format [-Wformat-extra-args]
 printf( "Average \n",Sum);
         ^~~~~~~~~~~~
prog.c:20:9: warning: too many arguments for format [-Wformat-extra-args]
 printf( "New Average \n",NewAvg);
         ^~~~~~~~~~~~~~~~
prog.c:10:12: warning: variable ‘Avg’ set but not used [-Wunused-but-set-variable]
 float Sum, Avg, NewSum, NewAvg;
            ^~~
stdout
Standard output is empty