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 output redirection?
How can you avoid including a header more than once?
Explain what are header files and explain what are its uses in c programming?
How do shell structures work?
What is typedef example?
What is the difference between class and object in c?
Explain how do you declare an array that will hold more than 64kb of data?
Is array a primitive data type in c?
Whats s or c mean?
The program will first compute the tax you owe based on your income. User is prompted to enter income. Program will compute the total amount of tax owed based on the following: Income Tax 0 - $45,000 = 0.15 x income $45,001 - $90,000 = 6750 + 0.20 x (income – 45000) $90,001 - $140,000 = 15750 + 0.26 x (income – 90000) $140,001 - $200,000 = 28750 + 0.29 x (income – 140000) Greater than $200,000 = 46150 + 0.33 x (income – 200000) Dollar amounts should be in dollars and cents (float point numbers with two decimals shown). Tax is displayed on the screen.
What is the general form of #line preprocessor?
Can we compile a program without main() function?
Explain what is output redirection?
what is the c source code for the below output? 5555555555 4444 4444 333 333 22 22 1 1 22 22 333 333 4444 4444 5555555555
What does c value mean?