Frequency of a character in a string

5

1 votes
Very-Easy
Problem

Write a program to find the frequency of a particular character in a string entered by the user. The character whose frequency is to be found out should also be taken from the user.

Format for Input:

the-character-to-find-frequency-of

the-string-in-which-to-find-the-frequency

Format for output:

count-of-the-character-in-the-string

Constraints: The string would have a maximum of 200 characters.

Time Limit: 5
Memory Limit: 256
Source Limit:
Explanation

Since there is 'o' 10 times in the string, the output is 10.

Editor Image

?