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

Answers were Sorted based on User's Feedback



write a programe returns the number of times the character appears in the string..

Answer / mohanraj

if(a[i]==q)

Is This Answer Correct ?    2 Yes 0 No

write a programe returns the number of times the character appears in the string..

Answer / 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

More C Interview Questions

How to print "Hi World" without using semi colon?

6 Answers   Infosys,


What is difference between structure and union in c programming?

0 Answers  


how to print this pyramid * * * * * * * * * * * * *

2 Answers  


Explain what is wrong in this statement?

0 Answers  


What is the difference between constant pointer and pointer to a constant. Give examples.

4 Answers   TCS,


what is a far pointer

12 Answers   ABB, DRDO, ITI, Maruti Suzuki, Steel Plant, TCS, Toyota, Vivo Mobiles,


What is type qualifiers?

0 Answers  


What are near, far and huge pointers?

0 Answers   Hexaware, Thomson Reuters, Virtusa,


how can i access hard disk address(physical address)? are we access hard disk by using far,near or huge pointer? if yes then please explain.....

0 Answers  


Explain what is the benefit of using an enum rather than a #define constant?

0 Answers  


pgm to find any error in linklist(in single linklist check whether any node points any of previous nodes instead of next node)

0 Answers   Huawei,


Write a program to print the following series 2 5 11 17 23 31 41 47 59 ...

2 Answers  


Categories