+ 1

Q bitwase operater c++

//#include <iostream> //using namespace std; #include<stdio.h> int main() { int a=5,b=9; cout<<"a="<<a<<"b="<<b; cout<<" a&b="<<a&b; cout<<"\n a|b="<<a|b; cout<<"\n a^b="<<a^b; cout<<"\n ~a="<<~a; cout<<"\n b<<1="<<(b<<1); cout<<"\n b>>1="<<(b>>1); return 0; }

11th Aug 2020, 5:03 AM
𝓡𝓪𝓰𝓱𝓪𝓿 𝓡𝓸𝓶𝓮𝓸
𝓡𝓪𝓰𝓱𝓪𝓿 𝓡𝓸𝓶𝓮𝓸 - avatar
3 ответов
+ 10
Bitwise operators perform operations on integer data at the individual bit-level. These operations include setting, or shifting the actual bits. Also please include relevant tags before posting any question. //Unclear question https://www.sololearn.com/discuss/333866/?ref=app
11th Aug 2020, 5:50 AM
Aditya
Aditya - avatar
+ 1
But where is error in my program?
11th Aug 2020, 6:58 AM
𝓡𝓪𝓰𝓱𝓪𝓿 𝓡𝓸𝓶𝓮𝓸
𝓡𝓪𝓰𝓱𝓪𝓿 𝓡𝓸𝓶𝓮𝓸 - avatar
0
Also take a look at std::bitset https://code.sololearn.com/c5OU4c44pQl4/#cpp
11th Aug 2020, 6:14 AM
Ockert van Schalkwyk
Ockert van Schalkwyk - avatar