Wednesday, 5 October 2011

swapping for 2 number using 1 extra alphabet


#include<stdio.h>
#include<conio.h>
main()
{
int a,b,c;
clrscr();
printf("enter the a");
scanf("%d",&a);
printf("enter the b");
scanf("%d",&b);
printf("value before swaping is\n ");
printf("value of a is %d\n",a);
printf("value of b is %d\n",b);
c=a;
a=b;
b=c;
printf("value after the swaping is\n ");
printf("value of a is %d\n",a);
printf("value of b is %d\n",b);
getch();
return 0;
}

No comments:

Post a Comment