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
When is the “void” keyword used in a function?
Why is c used in embedded systems?
What does printf does?
In a switch statement, explain what will happen if a break statement is omitted?
What are the applications of c language?
What is the g value paradox?
Can we access the array using a pointer in c language?
Why do we use stdio h and conio h?
What is call by reference in functions?
Write a program to print fibonacci series without using recursion?
What is action and transformation in spark?
Is there a built-in function in C that can be used for sorting data?
Apart from dennis ritchie who the other person who contributed in design of c language.
GIVEN A FLOATING POINT NUMBER HOW IS IT ACTUALLY STORED IN MEMORY ? CAN ANYONE EXPLAIN?? THE 32 BIT REPRESENTATION OF A FLOATING POINT NUMBER ALLOTS: 1 BIT-SIGN 8 BITS-EXPONENT 23 BITS-MANTISSA
Explain what is the use of a semicolon (;) at the end of every program statement?