Question: Write down a program in C that should do the following: Accept a user input for the size of data 'n' from the user. Randomly

Write down a program in C that should do the following: Accept a user input for the size of data 'n' from the user. Randomly generate 'n' integers in the range 0 to 9. Save the randomly generated integers in a file called 'data.txt'. Read the input file 'data.txt' and generate the frequency count of the integers in this file. Frequency count means the number of occurrences of each integer in the data. Create a new file 'output.txt'. In this file write down the result of frequency count from step 4. Make use of the frequency count in step 4 to sort the data in the file 'data.txt' in ascending order. Write down the sorted data in the output file output.txt after the frequency count. if you generated the following data: 2, 8, 9, 2, 7, 6, 5, 2, 9, 3, 3, 2, 5, then the data.txt file should have frequency count like: Sorted data: 2, 2, 2, 2, 3, 3, 5, 5, 6, 7, 8, 9, 9
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
