PROGRAM TO SWAP TWO NUMBERS USING C++

No comments

/*PROGRAM TO SWAP TWO NUMBERS*/



#include<iostream.h>
#include<conio.h>
#define SWAP(a,b) {int temp; temp=a; a=b; b=temp;}
void main()
{
clrscr();
intx,y;
cout<<“Enter two numbers:”;
cin>>x>>y;

cout<<“x=”<<x<<” y=”<<y;
SWAP(x,y);
cout<<“nx=”<<x<<” y=”<<y;
getch();
}


Output :-




No comments :

Post a Comment

Subscribe

Milan Panda
Admin
About Me | Contact
Copyright 2023-2024 © Programming1011 . 🎀 Developed and Design By- Milan Panda. Happy Holi All Of You 🎀