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 |
How can I convert integers to binary or hexadecimal?
How to create struct variables?
What is clrscr ()?
What language is lisp written in?
What is table lookup in c?
2. What does static variable mean?
What is dynamic memory allocation?
int j =15,i; for (i=1; 1<5; ++i) {printf ("%d%d ",j,i); j = j-3; }
When should the register modifier be used? Does it really help?
write a statement to display all the elements array M(in reverse order? int M[8]={20,21,22,23,24,25,26,27};
how do you execute a c program in unix.
What is #define used for in c?