Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save saifsmailbox98/7f6f3c94ccc2d04ed804b3cecbe126c5 to your computer and use it in GitHub Desktop.
Save saifsmailbox98/7f6f3c94ccc2d04ed804b3cecbe126c5 to your computer and use it in GitHub Desktop.
#include <stdio.h>
void main()
{
char a[50], b[50], c[50];
int i = 0;
printf("Enter the first string: ");
gets(a);
printf("Enter the second string: ");
gets(b);
for(; a[i]!='\0';i++){
c[i] = a[i];
}
for(int j=0; b[j]!='\0'; j++, i++){
c[i] = b[j];
}
c[i] = '\0';
printf("%s(length=%d)", c, i);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment