fork(1) download
  1. #include <stdio.h>
  2. int main(void)
  3. {
  4. int score[10];
  5. int totalScore = 0;
  6. int i;
  7. printf("Input the scores of ten students:\n");
  8. for(i=0;i<10;i++){
  9. scanf("%d",&score[i]);
  10. totalScore =totalScore +score[i];}
  11. printf("The average sore is %f\n",totalScore/10.0);
  12. return 0;
  13. }
Success #stdin #stdout 0s 544KB
stdin
100 101 99 102 98 103 97 104 96 100
stdout
Input the scores of ten students:
The average sore is 100.000000