Friday, June 4, 2021

C++ program swap two numbers (POP) (119)

#include<iostream>

using namespace std;

int main()

{

int num1,num2,swap;

    cout<<"enter first number:";

    cin>>num1;

      cout<<"enter second number:";

    cin>>num2;

    swap=num1;

    num1=num2;

    num2=swap;

    cout<<"after swaping the value of first number:"<<num1<<endl;

    cout<<"after swaping the second number is:"<<num2<<endl;

    return 0;

} 

No comments:

Post a Comment