WAP in C To Swap The Values Of Two Variables Without Using A Third Variable
#include<stdio.h>
#include<conio.h> void main() { int a,b; clrscr(); printf("\ENTER TWO NUMBERS FOR a AND b:\n"); scanf("%d%d",&a,&b); printf("\NBEFORE SWAPING THE VALUEOF a=%d And=%d",a,b); a=a+b; b=a-b; a=a-b; printf("\nafter the swaping the value of a=%d and b=%d" ,a,b); getch(); } |