Thursday, July 29, 2021

C++ Program to performed swap of two number using third variable

C++ Program to performed swap of two number using third variable

#include<iostream.h>

#include<conio.h>

void main()

{

 int t,a,b;

 clrscr();

 cout<<"\nEnter First Number : ";

 cin>>a;

 cout<<"\nEnter Second Number : ";

 cin>>b;

 cout<<"\nBefore Swap";

 cout<<"\nFirst Number = "<<a;

 cout<<"\nSecond Number = "<<b;

    t=a;

 a=b;

 b=t;

 cout<<"\nAfter Swap";

 cout<<"\nFirst Number = "<<a;

 cout<<"\nSecond Number = "<<b;

 getch();

}

   

No comments:

Post a Comment

Computer Network & Computer Features | Bal Varg | Computer Questions List!

  Computer Network & Computer Features 1) _______ is a thin strip like bar present at the bottom of the screen.   Taskbar 2) _______ ser...