Computer Science, asked by Shivanihani4350, 1 year ago

Solve Program to search occurrence of character in String.

Answers

Answered by mrunal6117
0

Given a string and a character, task is to make a function which count occurrence of the given character in the string.

Examples:

Input : str = "geeksforgeeks"

c = 'e'

Output : 4

'e' appears four times in str.

Input : str = "abccdefgaa"

c = 'a'

Output : 3

'a' appears three times in str.

Similar questions