C Program to swaping of two number

   #include <stdio.h>
int main() {
      double first, second, temp;
      printf("Please enter first number: ");
      scanf("%lf", &first);
      printf("Please enter second number: ");
      scanf("%lf", &second);

      // Value of first is assigned to temp
      temp = first;

      // Value of second is assigned to first
      first = second;

      // Value of temp (initial value of first number) is assigned to second
      second = temp;

      printf("\nAfter swapping, first Number = %.2lf\n", first);
      printf("After swapping, second Number = %.2lf", second);
      return 0;


Please enter first number: 40
Please enter second number:20
After swapping, first Number =20
After swapping, second Number = 40