write a programe returns the number of times the character
appears in the string
Answer Posted / vignesh1988i
#include<stdio.h>
#include<conio.h>
void main()
{
char a[50],q;
int count =0;
printf("enter the sring :");
gets(a);
printf("enter the char. to be searched :");
scanf("%c",&q);
for(int i=0;a[i]!='\0';i++)
{
if(a[i]==f)
count++;
}
printf("the occurance is :%d",count);
getch();
}
| Is This Answer Correct ? | 3 Yes | 4 No |
Post New Answer View All Answers
What are the types of bitwise operator?
What is #error and use of it?
Are the variables argc and argv are always local to main?
What is meant by keywords in c?
Where is c used?
what is diffrence between linear and binary search in array respect to operators?what kind of operator can be used in both seach methods?
What is 2c dna?
What is the use of bit field?
What is a void pointer? When is a void pointer used?
What is the purpose of type declarations?
Write a C program to count the number of email on text
Why is this loop always executing once?
Explain how can you restore a redirected standard stream?
What is a double c?
What does dm mean sexually?