my school teacher asked me to write a program to enter two number swap their values and display on the screen. Can someone help me in the program but the condition is that i have to make it only with two variables and using void satement
/**********************************
With three variable this is the programe
**********************************/
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
# include <iostream.h>
# include <conio.h>
void main ()
{
float a , b , c ;
clrscr () ;
cout << " Enter the value of a = " ;
cin << a ;
c = a ;
a = b ;
b = c :
cout << " Swapped results is " << a << " and " << b ;
getch () ;
}
/*************************************
And this is working correctly
************************************/