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
the question is that what you have been doing all these periods (one year gap)
An organised method of depicting the use of an area of computer memory used to signify the uses for different parts of the memory a) swap b) extended memory c) memory map d) all of the above
Why are all header files not declared in every c program?
What is output redirection?
What is calloc()?
What is the difference between ++a and a++?
Why is python slower than c?
What are pointers really good for, anyway?
List at least 10 sorting methods indicating their average case complexity, worst case complexity and best case complexity.
what do the 'c' and 'v' in argc and argv stand for?
What are structure types in C?
What are valid signatures for the Main function?
What does p mean in physics?
What is difference between array and pointer in c?
how could explain about job profile