Swaping Using Bit Wise Operator

Thursday, 8 September 2011

#include<stdio.h>
#include<conio.h>
void main()
{
int a,b;
clrscr();
printf("enter the value of a&b");
scanf("%d%d",&a,&b);
a=a^b;
b=a^b;
a=a^b;
printf("a=%d\nb=%d",a,b);
getch();
}


OUTPUT:


enter the value of a&b
2
3
a=3
b=2








No comments:

Post a Comment

 

Blogger news

Blogroll

Enter your email address:

Delivered by FeedBurner

Total Pageviews

Followers

Most Reading