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...


WAP TO ACCEPT STRING AND COUNT A COMES N TIMES B COMES N
TIMES C COMES N TIMES D COMES N TIMES AND SO ON.........
AT LAST UNTIL Z COMES N TIMES...............

Answers were Sorted based on User's Feedback



WAP TO ACCEPT STRING AND COUNT A COMES N TIMES B COMES N TIMES C COMES N TIMES D COMES N TIMES AN..

Answer / vignesh1988i

this logic is for 'A'(capital) to 'z'(small)......


#include<stdio.h>
#include<conio.h>
void main()
{
int count;
char str[100];
printf("enter the string :");
gets(str);
for(int i=65;i<=122;i++)
{
count =0;
for(int j=0;str[j]!='\0';j++)
{
if(str[j]==i)
count++;
}
printf("the character %c occurs %d times \n",i,count);
}
getch();
}

thank you

Is This Answer Correct ?    5 Yes 2 No

WAP TO ACCEPT STRING AND COUNT A COMES N TIMES B COMES N TIMES C COMES N TIMES D COMES N TIMES AN..

Answer / vignesh1988i

m minor modification


#include<stdio.h>
#include<conio.h>
void main()
{
int count;
char str[100];
printf("enter the string :");
gets(str);
for(int i=65;i<=122;i++)
{
count =0;
for(int j=0;str[j]!='\0';j++)
{
if(str[j]==(char)i)
{
printf("the character %c occurs %d times \n",i,count);

count++;
}
}
}
getch();
}

thank you

Is This Answer Correct ?    2 Yes 0 No

WAP TO ACCEPT STRING AND COUNT A COMES N TIMES B COMES N TIMES C COMES N TIMES D COMES N TIMES AN..

Answer / priyanka

#include<stdio.h>
#include<conio.h>
void main()
{
int i,j,count;
char str[100];
clrscr();
printf("enter the string :");
gets(str);
for(i=65;i<=122;i++)
{
count =1;
for(j=0;str[j]!='\0';j++)
{
if(str[j]==i)
count++;
}
printf("the character %c occurs %d times \n",i,count);
}
getch();
}


Is This Answer Correct ?    2 Yes 0 No

Post New Answer

More C Interview Questions

Hierarchy decides which operator a) is most important b) is used first c) is fastest d) operates on largest numbers

1 Answers  


a character variable can at a time store a) 1 character b) 8 characters c) 254 characters d) none of the above

3 Answers  


a construct the"else" part of "if" statement contains anoth "if else" statement is called a) if-else b) else-if-else c) if-else-if-else d) chain if/if-else-if

0 Answers  


What does c mean in basketball?

0 Answers  


Explain the advantages of using macro in c language?

0 Answers  


if the address of a[1,1] and a[2,1] are 1000 and 1010 respectively and each occupies 2 bytes then the array has been stored in what order?

4 Answers   Amazon, Apple, Bata, Google, NASA,


what is develop in c language

2 Answers  


How can I ensure that integer arithmetic doesnt overflow?

0 Answers  


Should I learn data structures in c or python?

0 Answers  


When would you use a pointer to a function?

0 Answers  


2. Write a function called hms_to_secs() that takes three int values&#8212;for hours, minutes, and seconds&#8212;as arguments, and returns the equivalent time in seconds.. Create a program that exercises this function by repeatedly obtaining a time value in hours, minutes, and seconds from the user (format 12:59:59), calling the function, and displaying the value of seconds it returns.

5 Answers   TCS,


what are the files which are automatically opened when a c file is executed?

3 Answers  


Categories