Advertisement
shawonrog

p2

Apr 11th, 2019
117
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.47 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <string.h>
  3.  
  4. int main()
  5. {
  6.     char Str1[100], Str2[100];
  7.     int i, j;
  8.  
  9.     printf("Please Enter the First String :  ");
  10.     gets(Str1);
  11.  
  12.     printf("Please Enter the Second String :  ");
  13.     gets(Str2);
  14.  
  15.     i = 0;
  16.     while( Str1[i]!='\0')
  17.     {
  18.         i++;
  19.     }
  20.  
  21.     j = 0;
  22.     while( Str2[j]!='\0')
  23.     {
  24.         Str1[i] = Str2[j];
  25.         i++;
  26.         j++;
  27.     }
  28.     Str1[i] = '\0';
  29.  
  30.     printf("String after the Concatenate = %s\n", Str1);
  31.  
  32.     return 0;
  33. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement