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
the real constant in c can be expressed in which of the following forms a) fractional form only b) exponential form only c) ascii form only d) both a and b
When should volatile modifier be used?
Explain the difference between the local variable and global variable in c?
Write a program to print ASCII code for a given digit.
largest Of three Number using without if condition?
Explain what is the difference between functions getch() and getche()?
Does c have enums?
How can I recover the file name given an open stream or file descriptor?
What is meant by high-order and low-order bytes?
In a switch statement, what will happen if a break statement is omitted?
Where does the name "C" come from, anyway?
What are preprocessor directives in c?
What are the advantages of union?
What is the correct code to have following output in c using nested for loop?
What is advantage of pointer in c?