Program:
#include<stdio.h>
int main(){
int a,b,temp;
a=15;
b=8;
printf("Before Swapping\na=%d\nb=%d\n",a,b);
a = a + b;
b = a - b;
a = a - b;
printf("\n\tAfter Swapping\n\ta=%d\n\tb=%d\n",a,b);
return 0;
}
Expected O/P:
Before Swapping
a=15
b=8
After Swapping
a=8
b=15
0 Comments
Post a Comment