TO SWAP THE VALUE OF TWO VARIABLES WITHOUT USING THIRD VARIABLE


#include<stdio.h>
#include<conio.h>
void main()
{
int a,b;
printf("Enter two values");
scanf("%d%d",&a,&b);
printf("Before sawpping A = %d B = %d",a,b);
a = a + b;
b = a - b;
a = a - b;
printf("\nAfter sawpping A = %d B = %d",a,b);
}

0 comments: (+add yours?)

Post a Comment