#include<iostream> using namespace std; int main() { int x, y; printf("\nEnter value for num1 & num2 : "); scanf("%d %d", &x, &y); x= x+ y; y = x - y; x = x- y; printf("\nAfter swapping value of x : %d", x); printf("\nAfter swapping value of y : %d", y); return (0); }
Output:
Enter value for num1 & num2 : 21 12
After swapping value of x : 12
After swapping value of y : 21
Post A Comment:
0 comments: