Program to swap 2 variables with out using of 3rd variable

 program to swap 2 variables with out using of 3rd variable.
1.  #include<stdio.h>
2.  void main()
3.  {
4.   int a,b;
5.   printf(“enter 2 numbers”);
6.   scanf(“%d %d”,&a,&b);
7.   printf(“nthe 2 numbers are %d %d”,a,b);
8.   a=a^b;
9.   b=a^b;
10.  a=a^b;
11.  printf(“n the 2 numbers are %d %d”,a,b);
12. }
This entry was posted in C Programs and tagged . Bookmark the permalink.