Question: Using C++ Write a program that accepts input from the keyboard (with the input terminated by pressing the Enter key) and counts the number of
Using C++ Write a program that accepts input from the keyboard (with the input terminated by pressing the Enter key) and counts the number of letters (A-Z and az), numerical digits (0-9), and other characters. Input the string using cin and use the following looping structure to examine each character in the string with an "if" statement and multiple "else if" statements. char s[50]; int i; . . . i = 0; while (s[i] != 0) { // a string is terminated with a null (0) value . . . i++; } Your program should make use of the relational operators (e.g., == < > <= >= !=) to determine whether a particular character is a letter, number, or other character. You may only #include and may not use any other include files.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
