After a string is accepted into str, a for loop is set up to traverse each character of the string. Within the body of the loop, each character of the string is checked against ch for equality.
in case of a match, the variable count is incremented. When this loop exits, the variable count will have the number of occurrences of the given character in the given string.
"Enter a String: "
"\nEnter a Character: "
/* Finding the no. of occurrences of character 'ch' in 'str' begins */
(i=0 ; str[i]!=
/* Find the no. of occurrences of 'ch' in 'str' ends */
"\nNo. of occurrences of '%c' in '%s' is %d"