SHARE
TWEET

2894strcat

sarmitacsediu Dec 3rd, 2019 70 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include<stdio.h>
  2. int main()
  3. {
  4.     char str1[30]="My name is";
  5.     char str2[]="Sarmita Roy";
  6.  
  7.     int i=0,len=0,j=0;
  8.     while (str1[i]!='\0')
  9.     {
  10.         i++;
  11.         len++;
  12.     }
  13.     while (str2[j]!='\0')
  14.     {
  15.         str1[len+j]=str2[j];
  16.         j++;
  17.     }
  18.     printf("string = %s\n",str1);
  19. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top