Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Fix code in C only, no arrays allowed, does anybody know why whenever i try to run this it just shows 0's and says invalid

Fix code in C only, no arrays allowed, does anybody know why whenever i try to run this it just shows 0's and says invalid number of arguments when it should display the output numbers and take the average, max, min numbers? It should match the sample output in the picture on the bottom. image text in transcribed
image text in transcribed
image text in transcribed
image text in transcribed
image text in transcribed
s out edu 7 f ca: findAverage (Int int): 8 t find Max (int int): 9 int findMin (int int) 10 int write Data (char int int) ll int main (int argc, char argv) 12 H 13 int arr int 15 arr (int )malloc (size sizeof (int)) 16 ir (lo Numbers (argv[1], arr, size) 0) 17 18 printf ("error"): 19 20 print Numbers (arr, size): 21 if (write Data (argv[2] arr, size) 1) 22 23 printf ("output written in output.txt' file"); 24 it (argc 2) 25 printt( invalid number of armuments passed. In 26 27 28 return o 300 int loadNumbers (char filename, int arr, int size) 31 t FILE. file tope (filename, "r") 33 if (file NULL) return 0; 35 36 while (!feof (file)) 38 int num: 39 fscanf (file, "id". 40 printf ("id", num) 41 43 if (count size) 46 47 return 49 void printNumbers (int arr, int size) O Type here to search o e a

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Concepts

Authors: David M. Kroenke

1st Edition

0130086509, 978-0130086501

More Books

Students also viewed these Databases questions

Question

2. Why has the conflict escalated?

Answered: 1 week ago