Search This Blog

Sunday, 23 August 2020

find the length of string using array type

 a#include<iostream>

using namespace std;

int main()

{


char name[20];

int i=1;

cout<<"Enter your name="<<endl;

cin>>name;

while(name[i]!='\0')

{

i++;

}

cout<<"lenght of the name is="<<i;

return 0;

}


No comments:

Post a Comment

Search This Blog

Contact Form

Name

Email *

Message *

Popular Posts