You are here:

C++/about programming

Advertisement


Question
can you please tell me one example of programming in no of letters can be count

Answer
Hai Dear Shivam!

 I think you are looking for a program that counts the number of character in a given string !

If my question was correct, you may use the code given below , this program reads the user input and count the number of characters in the given string !

#include<iostream.h>
int main()
{
  char buffer[100];
  int i = 0;
  int count = 0;

  cout<<"Enter a string :";
  cin.getline(buffer , 100 );
  cout<<buffer;

  while( buffer[i] != '\0')
  {
     count ++;
     i++;
  }

  cout<<"Character count = "<<count;


  return 0;
}

Note : If you are looking for some other programme , please revert me .

Thanks and Regards !
Prince M. Premnath

C++

All Answers


Answers by Expert:


Ask Experts

Volunteer


Prince M. Premnath

Expertise

Years of research in C/C++ Will bring you all facts regarding , OOPS , SVGA , MOUSE , BIOS , IVT , Feel free to query me :-)

Experience

More than 5 years

Education/Credentials
MCA

©2016 About.com. All rights reserved.