diff --git a/YP8v5m/cyXawI.cpp b/YP8v5m/cyXawI.cpp new file mode 100644 index 0000000..115e356 --- /dev/null +++ b/YP8v5m/cyXawI.cpp @@ -0,0 +1,21 @@ +#include +using namespace std; + +int main() +{ + //Initializing variable. + char str[30]; + int i,length=0; + //Accepting input. + cout<<"Enter the string:"; + gets(str); + //Initializing for loop. + for(i=0;str[i]!='\0';++i) + { + length++;//Counting the length. + } + + cout<<"Length of the string is:"<