Question
Write a program in C that computes the number of letters, digits, and special characters in an input sentence. The program should include the following
Write a program in C that computes the number of letters, digits, and special characters in an input sentence. The program should include the following function. Do not modify the function prototype. Special characters include: ~!@,:;%&*_+)( void count(int* num_letters, int* num_digits, int *num_special); The count function asks the user to enter a sentence. Use getchar() function to read in the input. The user input ends with the user pressing the enter key (a new line character). The count function takes three parameters of int *. The num_letters parameter points to a variable in which the function will store the number of letters. The num_digits parameter points to a variable in which the function will store the number of digits. The num_special parameter points to a variable in which the function will store the number of special characters. The main function calls the count function. It should also contain the printf statements that display the result. Example input/output: Enter a sentence: &&*3_little_PIGS!!! Output: There are 10 letters, 1 digit, and 8 special characters in the sentence.
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