Swap Two Numbers Without Using a Third Variable in C
This program shows how to swap the values of two variables without using a temporary (third) variable, using arithmetic operators. C Program #include <stdio.h> int main() { int a, b; printf(“Enter value of a: “); scanf(“%d”, &a); printf(“Enter value of b: “); scanf(“%d”, &b); printf(“\nBefore swapping: a = %d, b = %d\n”, a, b); a … Read more