fork download
  1. #include<stdio.h>
  2. int main()
  3. {
  4. int x, y;
  5. printf("Enter the value of x and y?");
  6. scanf("%d %d",&x,&y);
  7. printf("before swapping numbers: %d %d\n",x,y);
  8.  
  9. x = x + y;
  10. y = x - y;
  11. x = x - y;
  12. printf("After swapping: %d %d",x,y);
  13. return 0;
  14. }
Success #stdin #stdout 0s 5248KB
stdin
45
97
stdout
Enter the value of x and y?before swapping numbers: 45   97
After swapping: 97    45