#include<stdio.h>
#include<conio.h>
int main()
{
int a,b,temp;
printf("enter the value of a");
scanf("%d",&a);
printf("enter the value of b");
scanf("%d",&b);
printf("before swapping\n");
printf("the value of a is %d\n",a);
printf("the value of b is %d\n",b);
a=a+b;
b=a-b;
a=a-b;
printf("after swapping\n");
printf("the value of a is %d\n",a);
printf("the value of b is %d\n",b);
}
#include<conio.h>
int main()
{
int a,b,temp;
printf("enter the value of a");
scanf("%d",&a);
printf("enter the value of b");
scanf("%d",&b);
printf("before swapping\n");
printf("the value of a is %d\n",a);
printf("the value of b is %d\n",b);
a=a+b;
b=a-b;
a=a-b;
printf("after swapping\n");
printf("the value of a is %d\n",a);
printf("the value of b is %d\n",b);
}
No comments:
Post a Comment