C++/about programming
Expert: Prince M. Premnath - 8/11/2008
Questioncan you please tell me one example of programming in no of letters can be count
AnswerHai 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