C Programs RSS
Showing posts with label
Swapping of 2 Numbers {No Temp}
.
Show all posts
Showing posts with label
Swapping of 2 Numbers {No Temp}
.
Show all posts
Sunday, October 16, 2011
Swapping of 2 Numbers {No Temp}
#include<stdio.h>
#include<conio.h>
void main()
{
int a, b;
clrscr();
printf("Enter two numbers to swap ");
scanf("%d%d",&a,&b);
a = a + b;
b = a - b;
a = a - b;
printf("a = %d\nb = %d\n",a,b);
getch();
}
Older Posts
Home
Subscribe to:
Posts (Atom)