Saved Bookmarks
| 1. |
Write a C program to concatenate two strings. |
|
Answer» A program to concatenate two strings is given below: #include < stdio . h> #include < stdio . h> void main() { char a[100],b[100]; int i=0,j=0; clrscr(); printf("enter the set of lines"); gets(a); while(a[i]!='\0') { while(a[i]!=' '&&a[i]!='\t'&&a[i]!='\0') { b[j]=a[i]; j++; i++; } while(a[i]==' '||a[i]=='\t') i++; } b[j]='\0'; printf("%s",b); getch(); } |
|