printf ("The Character (%c) in a String (%s) occurs %d times ”,f,s,c);
I
PITIFUL
Enter a String: programmer
Enter a Character to Find: r
The Character (r) in a String (programmer) occurs (3) times.
ExplanationIn this program the string and a single character is entered through the keyboard.
Inside the for loop, i f statement checks each element of the string for occurrence of the single entered
character. If the character (' r')is found then c counter is increased otherwise without increasin ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month, and much more.