
#include<stdio.h>
#include<conio.h>
void main()
{
int x,y;
clrscr();
printf(“Enter value of X: “);
scanf(“%d”,&x);
printf(“Enter value of y: “);
scanf(“%d”,&y);
if(x>y)
{
y=x-y;
x=x-y;
y=x+y;
}
else
if(y>x)
{
x=y-x;
y=y-x;
x=y+x;
}
printf(“nx=%d”,x);
printf(“ny=%d”,y);
getch();
}
#include<conio.h>
void main()
{
int x,y;
clrscr();
printf(“Enter value of X: “);
scanf(“%d”,&x);
printf(“Enter value of y: “);
scanf(“%d”,&y);
if(x>y)
{
y=x-y;
x=x-y;
y=x+y;
}
else
if(y>x)
{
x=y-x;
y=y-x;
x=y+x;
}
printf(“nx=%d”,x);
printf(“ny=%d”,y);
getch();
}
0 comments:
Post a Comment