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
What is a volatile keyword in c?
What is integer constants?
What are the usage of pointer in c?
What is wrong with this program statement?
Why can't I perform arithmetic on a void* pointer?
What is the best style for code layout in c?
Explain what are the standard predefined macros?
Why is c known as a mother language?
how many errors in c explain deply
What do the functions atoi(), itoa() and gcvt() do?
Why do we use null pointer?
In a switch statement, explain what will happen if a break statement is omitted?
How do we open a binary file in Read/Write mode in C?
PLS U SENS ME INTERVIEW O. MY EMAIL ADD, SOFIYA.SINGH@GMAIL.COM
What is structure in c definition?