swapping without ternary opertsor
#include <stdio.h>
#include <conio.h>
#include <math.h>
int main (){
int a, b;
printf("Enter the value of a & b: ");
scanf("%d %d", &a, &b);
a = a + b;
b = a - b;
a = a - b;
printf("after swapping a and b = %d %d", a, b);
getch();
}
Click on the above button to download load the code fir future use.
Tags
Coding