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


Please Help Members By Posting Answers For Below Questions

Describe the steps to insert data into a singly linked list.

613


What is new line escape sequence?

797


Here is a good puzzle: how do you write a program which produces its own source code as output?

591


What is string function in c?

529


Explain what is dynamic data structure?

638






Differentiate between a structure and a union.

756


What is a pointer in c plus plus?

684


What is ponter?

763


Are local variables initialized to zero by default in c?

541


Explain the process of converting a Tree into a Binary Tree.

2094


Explain how does flowchart help in writing a program?

617


#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); }

759


What is cohesion in c?

533


How are 16- and 32-bit numbers stored?

717


What is the significance of an algorithm to C programming?

586