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.

Business, Finance, Economics, Accounting, Operations Management, Computer Science, Electrical Engineering, Mechanical Engineering, Civil Engineering, Chemical Engineering, Algebra, Precalculus, Statistics and Probabilty, Advanced Math, Physics, Chemistry, Biology, Nursing, Psychology, Certifications, Tests, Prep, and more.
Post Reply
answerhappygod
Site Admin
Posts: 899603
Joined: Mon Aug 02, 2021 8:13 am

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.

Post 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 49 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 49 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
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!
Post Reply