Answer Posted / 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 |
Post New Answer View All Answers
Why main is used in c?
What is #include stdio h?
What is string length in c?
Why do we use namespace feature?
When should structures be passed by values or by references?
What is pointer to pointer in c with example?
Differentiate call by value and call by reference?
What are the advantages of using Unions?
How many keywords are there in c?
Differentiate between null and void pointers.
Can you please explain the difference between exit() and _exit() function?
Explain the difference between malloc() and calloc() function?
Explain what is the use of a semicolon (;) at the end of every program statement?
Can we use visual studio for c?
What are the 4 types of organizational structures?