write a programe returns the number of times the character
appears in the string
Answers were Sorted based on User's Feedback
Answer / 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 |
What is a class?
main() { intx=2,y=6,z=6; x=y=z; printf(%d",x) }
5 Answers Amazon, HCL, Thought Works,
how can i get the string which is having two spaces at the end.suppose the string is "Hello World ".Now at the end i have two spaces.i need to print with that spaces .
what is the use of using linked list and array?
Write a program to swap two numbers without using third variable?
Explain how do you print an address?
Why c is called a middle level language?
what is the difference between #include<> and #include”…”?
How would you sort a linked list?
how can i include my own .h file EX:- alex.h like #include<alex.h>, rather than #include"alex.h"
When is a void pointer used?
what are the uses of structure?