#include<conio.h>
#include<iostream.h>
void main()
{
clrscr();
int num1,num2,temp;
cout<<"\nEnter Two Numbers" ;
cin>>num1>>num2;
cout<<"\nThe value of num1 and num2 before swaping is " <<"num1= " <<num1
<<" num2= "<<num2;
temp=num1;
num1=num2;
num2=temp;
cout<<"\nThe value of num1 and num2 After swaping is " <<"num1= " <<num1
<<" num2= "<<num2;
getch();
#include<iostream.h>
void main()
{
clrscr();
int num1,num2,temp;
cout<<"\nEnter Two Numbers" ;
cin>>num1>>num2;
cout<<"\nThe value of num1 and num2 before swaping is " <<"num1= " <<num1
<<" num2= "<<num2;
temp=num1;
num1=num2;
num2=temp;
cout<<"\nThe value of num1 and num2 After swaping is " <<"num1= " <<num1
<<" num2= "<<num2;
getch();
No comments:
Post a Comment