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
A: It allows a program to reference an identifier in global scope which has been hidden by another identifier along with the same name in the local scope.

develop a program read the following information from the keyboard in which base class consist of employee name code and destingnation the derived class contain the data members th

Program which can check the given string is super ascii or not

HWID Spoofer for Windows 7, 8 x64 Project Description: I want a simple program that will spoof my hardware id. I should be able to prepare the id to spoof to in the program a

C Program for REMOVING CHAR WHICH U WANT void main() {           int i,j;           char a[100],r;           clrscr();           for(i=0;i

Class Definition The following is the general format of defining a class template: class tag_name                  {                    public  :               // Must

The probabilistic Hough transform uses random sampling instead of an accumulator array. In this approach the number of random samples r, is not specified in the OpenCV call, but is

#questionhow can i add new customer and alot him a new unique id ..

c program for padovan string   Padovan series are positive integers obtained by the following process: The Padovan series is the sequence of integers P(n) defined by the

Write a C function to solve the system of linear equations A x = y where A is an N by N matrix in the format of pointer-to-pointers and y is a vector in the format of a pointer. Th