From a663edee64a81817ae9cd8e81b86529df9126b7d Mon Sep 17 00:00:00 2001 From: swayam khanduri <63970499+SWAYAMKHANDURI@users.noreply.github.com> Date: Sat, 7 Oct 2023 13:53:22 +0530 Subject: [PATCH] Create cyXawI.cpp Signed-off-by: swayam khanduri <63970499+SWAYAMKHANDURI@users.noreply.github.com> --- YP8v5m/cyXawI.cpp | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 YP8v5m/cyXawI.cpp 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:"<