Pages

Thursday, 4 October 2012

Count The Repeated Letter

#include <stdio.h>

#include <conio.h>

#include <string.h>

 

int main()

{

        char stng[20],rpt;

        int count, i;

        clrscr();

       

        printf("*****Program to Count The Repeated Letter*****");

        printf("\n\nEnter word : ");

        gets(stng);

       

        printf("Enter character : ");

        scanf("%c",&rpt);

       

        count = 0;

        i = 0;

        while(i != 19)

        {

                if(stng[i]==rpt)

                        count++;

                i++;

        }

       

        printf("\n%c is %d times repead.",rpt,count);

       

        getch();

        return 0;

}

0 comments:

Post a Comment