(Move to ...)
▼
Toggling using bit-wise XOR Operator
# include <iostream.h>
# include <conio.h>
void main ()
{
int a , b ;
a = 9 ;
b = 11 ;
cout<<"originalvalue="<<a<<endl;
cout<<"Toggled value=" <<(a^15);
cout<<"\n original value="<<b<<endl;
cout <<"\n Toggled value="<<(b^15);
}
No comments:
Post a Comment
‹
›
Home
View web version
No comments:
Post a Comment