InterviewSolution
Saved Bookmarks
| 1. |
Write the code to find the length of a string without using the string functions. |
|
Answer» #include <iostream>using namespace STD;int MAIN(){ char str[100]; int len = 0; cout << "Enter a STRING: "; cin >> str; while(str[len] != '\0') { len++; } cout << "Length of the GIVEN string is: " << len; cout << ENDL; return 0;} |
|