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
Describe the steps to insert data into a singly linked list.
What is new line escape sequence?
Here is a good puzzle: how do you write a program which produces its own source code as output?
What is string function in c?
Explain what is dynamic data structure?
Differentiate between a structure and a union.
What is a pointer in c plus plus?
What is ponter?
Are local variables initialized to zero by default in c?
Explain the process of converting a Tree into a Binary Tree.
Explain how does flowchart help in writing a program?
#include show(int t,va_list ptr1) { int a,x,i; a=va_arg(ptr1,int) printf(" %d",a) } display(char) { int x; listptr; va_star(otr,s); n=va_arg(ptr,int); show(x,ptr); } main() { display("hello",4,12,13,14,44); }
What is cohesion in c?
How are 16- and 32-bit numbers stored?
What is the significance of an algorithm to C programming?