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

What is a pointer in c?

3 Answers  


#include<stdio.h> int main() { int i=0,j=1,k=2,m,n=0; m=i++&&j++&&k++||n++; printf("%d,%d,%d,%d,%d",i,j,k,m,n); }

12 Answers   Capital IQ, Sasken,


How do I declare an array of N pointers to functions returning pointers to functions returning pointers to characters?

2 Answers  


Juxtapose the use of override with new. What is shadowing?

1 Answers  


What is the use of getchar() function?

0 Answers  


How can I remove the trailing spaces from a string?

0 Answers   Aspire,


Develop a flow chart and write a c program to find the roots of a quadratic equation ax2+bx+c=0 using switch and break statement.

1 Answers   TCS,


main() { int arr[5]={23,67}; printf("%d%d%d",arr[2],arr[3],arr[4]); }

9 Answers   TCS,


what are bps & baud rates? differentiate these two?

2 Answers   TCS,


Given an array of length N containing integers between 1 and N, determine if it contains any duplicates.

3 Answers   SilverKey,


What are 3 types of structures?

0 Answers  


What is the acronym for ansi?

0 Answers  


Categories