C program for count any characters which is u want, C/C++ Programming

 

# include stdio.h>

# include string.h>

# include conio.h>

void main()

 

{

          int i=0,count=0;

          char a[100],b;

          clrscr();

          for(i=0;i<100;i++)

          {

                   a[i]=0;

          }

          i=0;

          printf("\nENTER THE STRING: ");

          gets(a);

          printf("ENTER THE CHARACTER U WANT TO COUNT; ");

          scanf("%c",&b);

          for(i=0;a[i]!='\0';i++)

          {

                   if(a[i]==b)

                   {

                             count++;

                   }

          }

          printf("\nTHE CHARACTER IS %c",b);

          printf("\nTHE TOTAL OF ABOVE CHARACTER IS %d",count);

          getch();

}

OUTPUT :

ENTER THE STRING: KAMLESH D MENGAR

ENTER THE CHARACTER WHICH U WANT TO COUNT: A

 THE CHARACTER IS A

THE TOTAL OF ABOVE CHARACTER IS 2

Posted Date: 9/10/2012 4:21:02 AM | Location : United States







Related Discussions:- C program for count any characters which is u want, Assignment Help, Ask Question on C program for count any characters which is u want, Get Answer, Expert's Help, C program for count any characters which is u want Discussions

Write discussion on C program for count any characters which is u want
Your posts are moderated
Related Questions
Write a program that keeps record of football results. Program stores following information about each match: Description Type and/or size name of home team max. 25 characters name

#question.College life is tough. Eating pizza for every meal is hitting you hard. You are looking at working out to stay healthy. You found a web site that tells you how many ca

Operator Overloading Fundamentals The C language uses the concept of Operator Overloading discreetly. The asterisk (*) is used as multiplication operator as well as indirect


What I need is an auto-click bot. The auto-click bot would ask me for a url(or it would be pre-defined too) so that it loads that specific url and click an ad automatically. This w

P o i n t e r d e c l a r a t i o n f o r C l a s s : M m; M * p m; / / C la ss M i s d e c l a r e d a s

Explain about the Integer constants in c language? An integer constant is the integer valued number and it refers to a sequence of digits. A decimal integer constant includes o

#decode the code

Prepare aime crossover alert expert adviso Project Description: Need to develop an expert advisor base on aime crossover alert indicator. Skills required is C Programming