Tuesday, 1 October 2013

C PROGRAM TO SWAP TWO NUMBERS WITH USING ANOTHER VARIABLE

#include<stdio.h>
void main ()
{
int x,y,a;
clrscr();
printf("Enter any two numbers\n");
scanf("%d %d",&x,&y);
printf("x=%d \n y=%d",x,y);
a=x;x=y;y=a;
printf("\nswapping success\nx=%d\ny=%d",x,y);
getch();
}

No comments:

Post a Comment