Print Friendly and PDF
#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
zubairsaif

Zubair saif

A passionate writer who loves to write on new technology and programming

Post A Comment:

0 comments: