Follow Our FB Page << CircleMedia.in >> for Daily Laughter. We Post Funny, Viral, Comedy Videos, Memes, Vines...


Find occurence of a character in a sting.

Answers were Sorted based on User's Feedback



Find occurence of a character in a sting...

Answer / furquan

Use strchr

Is This Answer Correct ?    6 Yes 1 No

Find occurence of a character in a sting...

Answer / anil kumar nahak

void main()
{
char *st,ch;
int i=0,c=0;
printf("\n Enter The String: ");
gets(st);
printf("\n Enter A character For finding occurance: ");
scanf("%c",&ch);

while(st[i]!='\0')
{
if(st[i]==ch)
c++;
i++;
}
printf("\n %c Present In The String %d Times",ch,c);

}

Is This Answer Correct ?    4 Yes 2 No

Find occurence of a character in a sting...

Answer / chanti

strchr()
it is the function which we use in string() while we r
using characters in it.

Is This Answer Correct ?    1 Yes 1 No

Post New Answer



More C Interview Questions

What is bubble sort in c?

0 Answers  


What is c system32 taskhostw exe?

0 Answers  


Explain do array subscripts always start with zero?

0 Answers  


What is "Duff's Device"?

0 Answers   Celstream,


What does c mean in basketball?

0 Answers  






Prove or disprove P!=NP.

5 Answers   Microsoft,


Q.1 write a program to create binary tree 1 to 16 numbers? Q.2 write a program to creat a binary search tree for the member that is given by user?

0 Answers   Case, IBM,


main() { int a; a=++100; printf("%d",a); getch(); }

4 Answers  


Write a program to enter the name and age. If age>28 then find salary categories. if age<28 then find that you are gaduate or not.

1 Answers  


What is the significance of c program algorithms?

0 Answers  


How to create struct variables?

0 Answers  


what is the difference between c and java?

1 Answers  






Categories