eg. x = 10 y = 20 z = 30
output : x = 30 y = 10 z =20
#include <iostream.h>
#include <conio.h>
# include <stdio.h>
void main()
{
int x, y, z;
cout<< "\n Enter 3 nos :";
cin>> x >> y >> z ;
cout<<"\n Old values :\n";
cout << "x = " << x << " y = " <<< "z = " << z ;
x = x+y+z;
y = x - (y+z);
z = x - (y+z);
x = x - (y + z);
cout<<"\n New values :\n";
cout << "x = " << x << " y = " <<< "z = " << z ;
getch();
}
No comments:
Post a Comment