Advertisement
mario_mos

char1char2swap

Jul 24th, 2023 (edited)
34
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. #include <math.h>
  3. #include <stdlib.h>
  4. #include <time.h>
  5. #include <string.h>
  6. int main()
  7. {
  8.  
  9.  
  10. char ch1 [10];
  11. strcat(ch1,"bonjour");
  12. char ch2 [10];
  13. strcat(ch2,"gilles");
  14.  
  15.  
  16. printf("1ere Valeur de strcmp(): %d\n", strcmp(ch1, ch2));
  17.  
  18.  
  19. char temp;
  20. temp=*ch1;
  21. *ch1=*ch2;
  22. *ch2=temp;
  23.  
  24.  
  25. printf("2eme Valeur de strcmp(): %d\n", strcmp(ch1, ch2));
  26.  
  27.  
  28.  
  29.  
  30.  
  31.  
  32. return 0;
  33. }
  34.  
  35.  
  36.  
  37.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement