Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Name this program count.c-The program takes the name of an input file as its single command line argument and uses a function to count the
Name this program count.c-The program takes the name of an input file as its single command line argument and uses a function to count the number of upper-case letters, lower-case letters, and digits found in each string within the file. The main 2. program is shown below. You must write the function counts. This function is passed a string and returns the number of uppercase letters, lowercase letters, and digits through the second, third, and fourth parameters. The file DATA Alabama ./a. out DATA Alabama has 1 uppercase, 6 lowercase, and 0 digits has 4 uppercase, 4 lowercase, and 4 digits 1234crimABCD #%$@#$ has 0 uppercase , 0 lowercase, and 0 digits #8$@#$ | #include #include #include void counts (char *, int *, int *, int ) int main (int arge, char *argvl) ( FILE *fp = fopen (argv [1], char str [100]; fscanf(fp, "%s", str); while feof (fp) "r"); int upper, lower, digit; counts (str, upper, &lower, &digit); printf("%s has %d uppercase, %d lowercase, and %d digits ", str, upper, lower, digit) str); fscanf (fp, "%s", return 0
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started