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
How can I implement sets or arrays of bits?
What is the use of bitwise operator?
What is a structural principle?
write a program to find the given number is prime or not
What is the description for syntax errors?
What is a method in c?
Can we add pointers together?
Explain what are multibyte characters?
What is a union?
Why we use int main and void main?
What are different types of operators?
Write a program to input the price of 1 burger and the number of burgers eaten by a group of friends .print the total amount to be paid by the group?
Can you think of a logic behind the game minesweeper.
What is a substring in c?
What is getch () for?