#include<studio.h>
main()
{
  int a,b;
  printf("Enter a\n");
  scanf("%d",&a);
  printf("Enter b\n");
  scanf("%d",&b);
  printf("The values of a is %d
       and b is %d before swaping\n",a,b);
  a=a+b;
  b=a-b;
  a=a-b;
  printf("The values of a is %d
       and b is %d after swaping\n",a,b);
}
  
Output:-
Enter a
30
Enter b
35
The values of a is 30 and b is 35 before swaping
The values of a is 35 and b is 30 after swaping

Post a Comment

If you have any doubts, Please let me know
Thanks!

Previous Post Next Post