C Programs RSS
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();
}
No comments:
Post a Comment
Newer Post
Older Post
Home
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment