1 Answers
I know how to swap two variables without using a third variable. Take the first variable as 5 and take the second variable as double of 5 say 10.
Code:
#include<stdio.h>
int main()
{
int a = 5, b = 10;
printf(“Number before swapping: a : %d, b : %d”a,b);
a = a + b;
b = a – b;
a = a – b;
printf(“Number after swapping a:%d, b : %d”,a,b);