nahidhasan110

connect teo string

Dec 7th, 2019
50
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.40 KB | None | 0 0
  1. #include<stdio.h>
  2. #include<string.h>
  3. int main()
  4. {
  5.     char ch[50],ch1[50],ch2[50];
  6.     int i,j,l,ll,lll;
  7.     gets(ch);
  8.     gets(ch1);
  9.     l=strlen(ch);
  10.     ll=strlen(ch1);
  11.     lll=l+ll;
  12.     for(i=0;ch[i]!='\0';i++)
  13.     {
  14.         ch2[i]=ch[i];
  15.     }
  16.     for(j=l-1,i=0;j<lll,ch1[i]!='\0';j++,i++)
  17.     {
  18.         ch2[j]=ch1[i];
  19.     }
  20.     ch2[j]='\0';
  21.     printf("%s",ch2);
  22.     return 0;
  23. }
Add Comment
Please, Sign In to add comment