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
How can I find the modification date of a file?
How will you delete a node in DLL?
Explain what is a const pointer?
What's the best way of making my program efficient?
What are valid operations on pointers?
Write a program to check palindrome number in c programming?
How can you return multiple values from a function?
What's the right way to use errno?
differentiate built-in functions and user – defined functions.
What is the difference between variable declaration and variable definition in c?
What is string function c?
a sequence of bytes with one to one corrspondence to those in the external device a) sequential addressing b) address c) byte code d) none
What are the Advantages of using macro
Can you return null in c?
What is the difference between far and near in c?