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
Which is an example of a structural homology?
What does %p mean?
What are structure types in C?
How do you convert strings to numbers in C?
Explain what is the best way to comment out a section of code that contains comments?
Explain what is the use of a semicolon (;) at the end of every program statement?
What is the role of && operator in a program code?
What is the difference between abs() and fabs() functions?
Why functions are used in c?
will u please send me the placement papers to my mail???????????????????
How main function is called in c?
What is getch c?
What is the difference between text files and binary files?
Compare and contrast compilers from interpreters.
What are the 5 types of inheritance in c ++?