Nafiz_Ahmed

Untitled

Jul 28th, 2019
118
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.44 KB | None | 0 0
  1. #include <stdio.h>
  2. #define MAX_SIZE 100
  3. int main()
  4. {
  5. int text1[MAX_SIZE],text2[MAX_SIZE];
  6. int i,j;
  7. printf("Input string1:");
  8. gets(text1);
  9. printf("Input string2:");
  10. gets(text2);
  11. i=0;
  12. while(text1[i]!=0){
  13. i++;
  14. }
  15. j=0;
  16. while(text2[j]!=0){
  17. text1[i]=text2[j];
  18. i++;
  19. j++;
  20. }
  21. text1[i]='\0';
  22. printf("Concatenated string: %s\n",text1);
  23.  
  24. return 0;
  25. }
Advertisement
Add Comment
Please, Sign In to add comment