#include<iostream.h>
#include<conio.h>
int length(char ch[])
{
                int i=0;
                while(ch[i]!='\0')
                                {
                                i++;
                                }
                return (i);
}
void main()
{
                char name[20];
                clrscr();
                cout<<"Enter Your Name : ";
                cin>>name;
                cout<<"\nThe Entered Name Is : "<<name;
                cout<<"\nAnd Its Length : "<<length(name);
                getch();
}

125.PNG

Advertisements