Thursday, June 17, 2010

Swapping of Two No.

#include<stdio.h>

main()
{
  int a,b,temp;
  clrscr();
  printf("Enter Two No.: ");
  scanf("%d %d",&a,&b);
 
  printf("\nEntered No. are: ");
  printf("%d %d",a,b);
 
  temp=a;
  a=b;
  b=temp;
 
  printf("\n\nSwapped No. are: ");
  printf("%d %d",a,b);
 
}
Output-------->

No comments: