Page 1 of 1

Can help me to solve the calculation for the average part. Numbers in the text file is 10, 20, 30,40, 50. Average is 30.

Posted: Mon Jul 11, 2022 9:49 am
by answerhappygod
Can help me to solve the calculation for the average part.
Numbers in the text file is 10, 20, 30,40, 50. Average is30.
Can Help Me To Solve The Calculation For The Average Part Numbers In The Text File Is 10 20 30 40 50 Average Is 30 1
Can Help Me To Solve The Calculation For The Average Part Numbers In The Text File Is 10 20 30 40 50 Average Is 30 1 (41.88 KiB) Viewed 50 times
My output answer is wrong.
Can Help Me To Solve The Calculation For The Average Part Numbers In The Text File Is 10 20 30 40 50 Average Is 30 2
Can Help Me To Solve The Calculation For The Average Part Numbers In The Text File Is 10 20 30 40 50 Average Is 30 2 (3.92 KiB) Viewed 50 times
1 #include 2 #include HN3&ST89 4 int main() { 5 6 7 10 11 12 13 14 15 16 17 18 19 20 21 22} char number [5]; int i, count=0, total=0; double num=5; FILE *file; file = fopen("textFile.txt", "r"); if (file) { } while ((number = fgetc(file)) != EOF) { printf("%c", number); total += num; count++; } printf("Average = %.2f\n", total/num); fclose(file); return 0;
10 20 30 40 50 Average = 15.00