English Deutsch Français Italiano Español Português 繁體中文 Bahasa Indonesia Tiếng Việt ภาษาไทย
All categories

write a program that accepts a string input. it then counts the no. of character.
this is the given output:
Input a string:Hello world
No. of Character:10

2007-03-13 18:49:53 · 3 answers · asked by Anonymous in Computers & Internet Programming & Design

3 answers

// all those #include and main() doodads

char strline[50];
cout << "Input a string: ";
cin >> strline;
cout << "No. of Characters: " << strlen(strline);

2007-03-13 19:09:37 · answer #1 · answered by Andy T 7 · 1 0

yeah okay, true, but don't forget that it counts spaces as well, so it's actually 11

2007-03-14 06:36:22 · answer #2 · answered by Anonymous · 0 0

#include
#include

char *blah;

int main() {
cin >> blah;
cout << strlen(blah) << endl;
system("pause");
}

2007-03-15 16:09:57 · answer #3 · answered by nickthegreek 3 · 0 0

fedest.com, questions and answers