DOC PREVIEW
GSU CSC 3320 - Homework9

This preview shows page 1 out of 4 pages.

Save
View full document
View full document
Premium Document
Do you want full access? Go Premium and unlock all 4 pages.
Access to all documents
Download any document
Ad free experience
Premium Document
Do you want full access? Go Premium and unlock all 4 pages.
Access to all documents
Download any document
Ad free experience

Unformatted text preview:

Homework 9CSC 3320Write a C program, which reads the file “file.txt” and counts the frequency of each digit (0, 1, 2, ..., 9)/letter (A/a, B/b, …, Z/z). Then, use fork() to duplicate a child process to write the most frequent digit/letter at the end of the file “file.txt”. The parent process output the frequency of each digit/letter to the terminal. You need to call the function “mostfrequent” (which is used for calculating the most frequent digit/letter defined below) in your program.int mostfrequent(int * a, int length) /*length is the length of the array. The function returns the index of the largest value of array a.*/{ int index=0; int max=a[0]; int i; for(i=1;i<length;i++) if (a[i]>max) { max = a[i]; index = i; } return index;}Here is the running


View Full Document

GSU CSC 3320 - Homework9

Download Homework9
Our administrator received your request to download this document. We will send you the file to your email shortly.
Loading Unlocking...
Login

Join to view Homework9 and access 3M+ class-specific study document.

or
We will never post anything without your permission.
Don't have an account?
Sign Up

Join to view Homework9 2 2 and access 3M+ class-specific study document.

or

By creating an account you agree to our Privacy Policy and Terms Of Use

Already a member?