C
Programming and Technical
Write a program which uses functions like strcmp(),
strcpy()? etc
Read Solution (Total 1)
-
- #include
#include
void main()
{
char name[]="Aarush";
char rel[]="My Nephew";
char copy[15];
int L1,L2,i,j,k;
L1=strlen(name);
L2=strlen(rel);
printf("n%s length=%d",name,L1);
printf("n%s length=%d",rel,L2);
i=strcmp(name,"Aarush");
j=strcmp(name,"Barush");
k=strcmp(name,"Aarush child");
strcpy(copy,name);
strcat(rel,name);
printf("ncoppied string=%s",copy);
printf("nconcatenated string=%s",rel);
printf("n%dt%dt%d",i,j,k);
getch();
}
OUTPUT:
Aarush length=6
My Nephew length=9
coppied string=Aarush
concatenated string=My NephewAarush
0 -1 -32
- 11 years agoHelpfull: Yes(0) No(0)
C Other Question