//Program to Swap
//Downloaded from www.c4cprog.co.nr
#include<conio.h>
void main()
{
int a,b,c;
clrscr();
printf("\nEnter Nos. A & B\n");
scanf("%d%d",&a,&b);
c=a;
a=b;
b=c;
printf("\nThe Swapped Val : A=%d , B=%d ",a,b);
printf("\n\nMethod II \n");
printf("\n\n\nEnter Nos. A & B\n");
scanf("%d%d",&a,&b);
a=a-b;
b=a+b;
a=b-a;
printf("\nThe Swapped Val : A=%d , B=%d ",a,b);
getch();
}
Programs Can Also Be Downloaded From The Folders Below....[Or Scroll Down]
Swap 2 nos. without using third variable
Click Here To Download C File Of This Program
Subscribe to:
Post Comments (Atom)
0 comments:
Post a Comment