CJCoding With Joseph
15free / daySign inCreate account

Count A Chosen Letter

Read a word and then a single letter, count how many times that letter appears in the word by comparing each character with it in a for loop, and print the result in the form <letter> appears <count> times. Input: two lines, the word then the letter, no prompts. A letter that never appears prints a count of 0.

Expected Output:

s appears 4 times

= newline. The output ends with a newline — print one after the last line.

Hints3 available
Topics:
Strings
📥 Auto-Input:
mississippi\ns\n
This input is automatically fed to your program's stdin
1
Tab to indent (Esc then Tab to move on) · Ctrl+Enter to run · Ctrl+Space to expand shortcuts (pr, inp, def)

Your Output

Run your code to see the output here...

Test Cases

Run your code to see test case results.