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
What is the benefit of using #define to declare a constant?
Why do we use static in c?
Explain how can I convert a number to a string?
What is a lvalue
What was noalias and what ever happened to it?
What is the use of c language in real life?
Linked lists -- can you tell me how to check whether a linked list is circular?
Is fortran still used in 2018?
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.
What is memory leak in c?
Explain what are reserved words?
Here is a neat trick for checking whether two strings are equal
What is the incorrect operator form following list(== , <> , >= , <=) and what is the reason for the answer?
What are global variables?
What is the use of header files?