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

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



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Which header file is used for clrscr?

999


What is wrong with this program statement? void = 10;

1204


List the different types of c tokens?

1011


Why is not a pointer null after calling free?

970


Is return a keyword in c?

1030


What is #define?

1039


Explain what is the concatenation operator?

1108


What is the use of a static variable in c?

1008


What are the main characteristics of c language describe the structure of ac program?

1149


What is c language and why we use it?

1004


What is difference between structure and union with example?

990


Explain what does it mean when a pointer is used in an if statement?

1005


define string ?

1057


What is the difference between declaring a variable by constant keyword and #define ing that variable?

3285


Read the following data in two different files File A: aaaaaaaadddddddd bbbbbbbbeeeeeeee ccccccccffffffff File B: 11111111 22222222 33333333 By using the above files print the following output or write it in the Other file as follows aaaaaaaa11111111dddddddd bbbbbbbb22222222eeeeeeee cccccccc33333333ffffffffffff

3206