wap to swap the two number without using 3rd variable in c language
wap to swap the two number without using 3rd variable in c language
Program:-
#include<stdio.h>
#include<conio.h>
main()
{
int a,b,c;
clrscr();
printf("enter the value for a");
scanf("%d",&a);
printf("enter the value for b");
scanf("%d", & b);
printf("before swaping value of a=%d and b=%d",a,b);
a=a+b;
b=a-b;
a=a-b;
printf("after swaping value of a=%d and b=%d",a,b);
getch();
}
No comments
Post a Comment