fork download
  1. #include<stdio.h>
  2. int main()
  3. {
  4. double first, second, temp;
  5. printf("Enter first number: ");
  6. scanf("%lf", &first);
  7. printf("Enter second number: ");
  8. scanf("%lf", &second);
  9.  
  10.  
  11. temp = first;
  12.  
  13.  
  14. first = second;
  15.  
  16.  
  17. second = temp;
  18.  
  19.  
  20. printf("\nAfter swapping, first number = %.2lf\n", first);
  21. printf("After swapping, second number = %.2lf", second);
  22. return 0;
  23. }
Success #stdin #stdout 0s 5312KB
stdin
45
53
stdout
Enter first number: Enter second number: 
After swapping, first number = 53.00
After swapping, second number = 45.00