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
Why pointers are used in c?
What is the Purpose of 'extern' keyword in a function declaration?
Which is the best website to learn c programming?
What is a 'null pointer assignment' error? Explain what are bus errors, memory faults, and core dumps?
What is a keyword?
#include
What is the purpose of clrscr () printf () and getch ()?
what do you mean by inline function in C?
Explain how can I manipulate strings of multibyte characters?
What does c mean in standard form?
Do pointers store the address of value or the actual value of a variable?
What are the features of the c language?
Should I learn c before c++?
Iam a B.Tech graduate and completed my engineering in 2009, from 2005 to 2009 and after that i had done nothing.Now i want to do job and get into BPO field . Friends give me suggestions as what to say in interview... if they ask me that what would you had done ... these many years without doing job ??????? pls urgent
write a c program to find the largest and 2nd largest numbers from the given n numbers without using arrays