Advertisement
AzmayenSabil

Untitled

Oct 15th, 2021
35
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.26 KB | None | 0 0
  1. #include <stdio.h>
  2.  
  3. int main()
  4. {
  5. int x,y,*a,*b,temp;
  6.  
  7. printf("Give the value of x and y\n");
  8. scanf("%d %d", &x, &y);
  9.  
  10. a = &x;
  11. b = &y;
  12.  
  13. temp = *b;
  14. *b = *a;
  15. *a = temp;
  16.  
  17. printf("after the swap \n%d %d", x, y);
  18.  
  19. return 0;
  20. }
  21.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement