Sunday, June 24, 2012

Swap number using three variables

#include<stdio.h>
#include<conio.h>
int main(void)
{
   int x,y,z;
   printf("\nEnter First Number : ");
   scanf("%d",&x);
   printf("\nEnter Second Number : ");
   scanf("%d",&y);
   z=x;
   x=y;
   y=z;
   printf("\n\nAfter Swapping\n\n");
   printf("\nFirst Number : %d\nSecond Number : %d",x,y);
   return 0;
}

0 comments:

Post a Comment