Categories |
INNOVATORSWORLD
Innovative ideas,latest tricks,technical news,stay tune with latest updates
program to find number of letter using c | 5:10 AM |
comments (0)
Filed under:
|
/*MY PROGRAM TO FIND RECURRENCE OF LETTERS IN A STRING USING C*/
#include< stdio.h>
#include< conio.h>
#include< string.h>
void main()
{
int i=0 ,count;
char gh[100],c,j;
printf("enter the string\n");
c=getche();
while(c!='0')
{
gh[i]=c;
c=getche();
i++;
}
printf("%s\n",gh);
printf("string length is %d",strlen(gh));
for(j='a';j< ='z';j++)
{
count=0;
for(i=0;i< strlen(gh);i++)
{
if(j==gh[i])
{
count++;
}
}
if(count!=0)
{
printf("\n%d %c",count,j);
}
}
getchar();
Subscribe to:
Posts (Atom)