#include<stdio.h>
main()
{
int a,b;
printf("\n Enter any two numbers to swap");
scanf("%d %d",&a,&b);
printf("\n Before swaping two numbers are a=%d and b=%d",a,b);
a=a+b;
b=a-b;
a=a-b;
printf("\n After swaping two numbers are a=%d and b=%d",a,b);
getch();
}
main()
{
int a,b;
printf("\n Enter any two numbers to swap");
scanf("%d %d",&a,&b);
printf("\n Before swaping two numbers are a=%d and b=%d",a,b);
a=a+b;
b=a-b;
a=a-b;
printf("\n After swaping two numbers are a=%d and b=%d",a,b);
getch();
}
No comments:
Post a Comment