Advertisement
RAJIBRAJU

2.swip in function

Jul 5th, 2019
148
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.30 KB | None | 0 0
  1. #include <stdio.h>
  2. int swip (int x ,int y)
  3. {
  4.     int temp;
  5.  
  6.   temp = y;
  7.    y   = x;
  8.    x   = temp;
  9.  
  10.    printf("After Swapping\nx = %d\ny = %d\n", x, y);
  11. }
  12.  
  13. int main()
  14. {
  15.    int x, y,result ;
  16.  
  17.    printf("Enter the value of x and y\n");
  18.    scanf("%d%d", &x, &y);
  19. swip(x,y);
  20.  
  21.    return 0;
  22. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement