Search This Blog

Translate

C program to swap two number using bit wise operator

C program to swap two number using bit wise operator

#include
#include
void main()
{
int no1,no2;
clrscr();
printf("Enter the value for A=");
scanf("%d",&no1);
printf("\n\nEnter the value for B=");
scanf("%d",&no2);
no1=no1^no2;
no2=no1^no2;
no1=no1^no2;
printf("\n\n After swapping the value of\n\nA=%d\n\nB=%d",no1,no2);
getch();
}


C program to swap two number using bit wise operator

C Program example List

Google+ Badge