Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

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


Please Help Members By Posting Answers For Below Questions

Which is an example of a structural homology?

1328


What does %p mean?

1097


What are structure types in C?

1109


How do you convert strings to numbers in C?

1234


Explain what is the best way to comment out a section of code that contains comments?

1143


Explain what is the use of a semicolon (;) at the end of every program statement?

1237


What is the role of && operator in a program code?

1081


What is the difference between abs() and fabs() functions?

1137


Why functions are used in c?

1146


will u please send me the placement papers to my mail???????????????????

1844


How main function is called in c?

1134


What is getch c?

1311


What is the difference between text files and binary files?

1356


Compare and contrast compilers from interpreters.

1126


What are the 5 types of inheritance in c ++?

1030