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

How can I find the modification date of a file?

1264


How will you delete a node in DLL?

1277


Explain what is a const pointer?

1071


What's the best way of making my program efficient?

1084


What are valid operations on pointers?

1179


Write a program to check palindrome number in c programming?

1002


How can you return multiple values from a function?

1101


What's the right way to use errno?

1127


differentiate built-in functions and user – defined functions.

1070


What is the difference between variable declaration and variable definition in c?

1044


What is string function c?

1004


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

1253


What are the Advantages of using macro

1154


Can you return null in c?

1143


What is the difference between far and near in c?

1052