Question: C Language Programming: Question: Devise a program that counts the number of characters in its input up to the end of file. I enclose the

C Language Programming:

Question: "Devise a program that counts the number of characters in its input up to the end of file."

I enclose the Main driver and my program for count_ch.

"Main driver"

C Language Programming: Question: "Devise a program that counts the number of

Here is my prgram for count_ch

characters in its input up to the end of file." I enclose

My problem is that if I run my program without the "main driver" my program runs correctly. I don't know what's wrong with it. Please have a look at it on count_ch program and correct if there is any mistake. Thanks for your help!

#include #include //header file for input/output int menu(void) //prototype definition /*Place the function prototypes for your programs here! / void count_ch(void); void chartype (void); void betterguess (void); int main(void) int selectionmenu(); /Ivariable declaration and initialization via call to menu //The line above also serves as the priming" read for the following while loop while (selection ! 99) //The switch statement is similar to a chained if-else except conditions fall through in C! switch(selection) case 1: count ch); break; case 2: chartype) break; case 3: betterguess); break; case 4: break; default: /* Optional-but a good idea expecially if you have no other error catching! */ printf("Please enter a valid selection. "); selection = menu(); // get the next menu selection, otherwise, you have an eternal loop! return 0; int menu(void) int choice; printf("%n"); printf("1. Character count In") printf(" 2. Character type n") printf(" 3. Better Guess ") printf" 4. In") printf("99. Exit "); printf("Please select number and press enter: ") printf("n"); scanf ("%d", &choice); return choice

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!