fork(1) download
  1. #include <stdio.h>
  2. int main(void)
  3. {
  4. int score[5];
  5. int totalScore = 0;
  6. int i;
  7. printf("Input the scores of five students:\n");
  8. for(i=0;i<5;i++){
  9. scanf("%d",&score[i]);
  10. totalScore =totalScore +score[i];}
  11. printf("The average sore is %f\n",totalScore/5.0);
  12. return 0;
  13. }
Success #stdin #stdout 0s 544KB
stdin
100,108,123,120,114
stdout
Input the scores of five students:
The average sore is -213657806.800000