SHARE
TWEET

Untitled

a guest Jul 11th, 2019 70 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include <stdio.h>
  2.  
  3. void squeeze1(char s1[], char s2[]);
  4.  
  5. int main()
  6. {
  7.     char z[] = "Hello!";
  8.     printf("%s\n", z);
  9.     squeeze1(z, "Heo!");
  10.     printf("%s\n", z);
  11.    
  12.     system("pause");
  13.     return 0;
  14. }
  15.  
  16. void squeeze1(char s1[], char s2[])
  17. {
  18.      int i, j, z;
  19.      
  20.      for(i = 0; s1[i] != '\0'; i++)
  21.            for(j = 0; s2[j] != '\0'; j++)
  22.                  if(s1[i] == s2[j]){
  23.                           z = i;
  24.                           while(s1[z] != '\0')
  25.                                       s1[z] = s1[++z];
  26.                  }
  27.      
  28.                  
  29.      s1[i] = '\0';
  30. }
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