PROGRAM TO FIND LENGTH OF A NAME USING CPP
#include<conio.h>
#include<iostream.h>
#include<string.h>
void main()
{
char name1[40],name2[40];
clrscr();
cout<<"enter your
first name";
cin>>name1;
cout<<"Enter your
second name";
cin>>name2;
strcat(name1,name2);
cout<<"your name
is"<<name1;
getch();
}
OUTPUT:
Enter your name haneesh
The length of name is 7
No comments: