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 / priyanka
#include<stdio.h>
#include<conio.h>
void main()
{
int i,j,count;
char str[100];
clrscr();
printf("enter the string :");
gets(str);
for(i=65;i<=122;i++)
{
count =1;
for(j=0;str[j]!='\0';j++)
{
if(str[j]==i)
count++;
}
printf("the character %c occurs %d times \n",i,count);
}
getch();
}
| Is This Answer Correct ? | 2 Yes | 0 No |
Post New Answer View All Answers
Is the exit() function same as the return statement? Explain.
What does main () mean in c?
What is the use of header files?
What is the difference between the = symbol and == symbol?
Does c have circular shift operators?
how to solve "unable to open stdio.h and conio.h header files in windows 7 by using Dos-box software
List some applications of c programming language?
What is the difference between text and binary i/o?
How are strings stored in c?
What is spark map function?
write a C program: To recognize date of any format even formats like "feb-02-2003","02-february-2003",mm/dd/yy, dd/mm/yy and display it as mm/dd/yy.
while loop contains parts a) initialisation, evalution of an expression,increment /decrement b) initialisation, increment/decrement c) condition evalution d) none of the above
how to execute a program using if else condition and the output should enter number and the number is odd only...
What are near, far and huge pointers?
There seem to be a few missing operators ..