➽ Program:-

#include<iostream>

using namespace std;

int main()

{

    float num1, num2, temp;

 

    cout<<"Enter First Number: ";

    cin>>num1;

    cout<<"Enter Second Number: ";

    cin>>num2;

 

    temp = num1;

    num1 = num2;

    num2 = temp;

 

    cout<<"After swapping, First Number = " << num1 << endl;

    cout<<"After swapping, Second Number = " << num2 << endl;

    return 0;

}

➽ Output:-

Enter First Number: 7.8
Enter Second Number: 12.6
After swapping, First Number = 12.6
After swapping, Second Number = 7.8