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

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



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the benefit of using #define to declare a constant?

1043


Why do we use static in c?

1063


Explain how can I convert a number to a string?

1099


What is a lvalue

1039


What was noalias and what ever happened to it?

976


What is the use of c language in real life?

972


Linked lists -- can you tell me how to check whether a linked list is circular?

1031


Is fortran still used in 2018?

985


You are to write your own versions of strcpy() and strlen (). Call them mystrcpy() and mystrlen(). Write them first as code within main(), not as functions, then, convert them to functions. You will pass two arrays to the function in the case of mystrcpy(), the source and target array.

2275


What is memory leak in c?

1059


Explain what are reserved words?

1038


Here is a neat trick for checking whether two strings are equal

966


What is the incorrect operator form following list(== , <> , >= , <=) and what is the reason for the answer?

1382


What are global variables?

1113


What is the use of header files?

1054