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
Is there a way to compare two structure variables?
What are different storage class specifiers in c?
What are the characteristics of arrays in c?
How to write a multi-statement macro?
What is substring in c?
What is variable and explain rules to declare variable in c?
Write the Program to reverse a string using pointers.
Explain the binary height balanced tree?
how should functions be apportioned among source files?
Do you have any idea about the use of "auto" keyword?
any "C" function by default returns an a) int value b) float value c) char value d) a & b
You are to write your own versions of strcpy() and strlen (). Call them mystrcpy() and mystrlen(). Write them first as code within main(), not as functions, then, convert them to functions. You will pass two arrays to the function in the case of mystrcpy(), the source and target array.
What is ## preprocessor operator in c?
What are the advantages and disadvantages of a heap?
What is output redirection?