fork download
  1. #include <stdio.h>
  2.  
  3. int main(void) {
  4. int x, y, temp;
  5. printf("Enter the value of x and y: ");
  6. scanf("%d %d", &x, &y);
  7. printf("Before swapping x=%d, y=%d ", x, y);
  8. temp = x;
  9. x = y;
  10. y = temp;
  11. printf("After swapping x=%d, b=%d", x, y);
  12. return 0;
  13. }
  14.  
Success #stdin #stdout 0s 9416KB
stdin
Standard input is empty
stdout
Enter the value of x and y: Before swapping x=0, y=0 After swapping x=0, b=0