#include<stdio.h>
#include<conio.h>
main()
{
int a,b,c;
clrscr();
printf("\n enter A and B values");
scanf("%d%d",&a,&b);
printf("\n Before Swapping A is %d and B is %d",a,b);
c=a;
a=b;
b=c;
printf("\n After swapping A is %d and B is %d ",a,b);
getch();
}
OUTPUT:
enter A and B values 34 78
Before Swapping A is 34 and B is 78
After Swapping A is 78 and B is 34
#include<conio.h>
main()
{
int a,b,c;
clrscr();
printf("\n enter A and B values");
scanf("%d%d",&a,&b);
printf("\n Before Swapping A is %d and B is %d",a,b);
c=a;
a=b;
b=c;
printf("\n After swapping A is %d and B is %d ",a,b);
getch();
}
OUTPUT:
enter A and B values 34 78
Before Swapping A is 34 and B is 78
After Swapping A is 78 and B is 34
No comments:
Post a Comment