INDEX

4.09.2012

Position of character and How many times character repeat in string

Q. write a C program to accept a string from user and after that accept a single character from user and search whether this character include in string or not if is is include then find out the position of character and also calculate, how many times character repeat?

For example:

Entered string : This is C programming

Entered character for search: p

Position of p in string : 11

Repeation of p in string : 1

Ans.

/*c program for search character and if is include then how many times present in string*/