Run ❯
Get your
own
website
×
Change Orientation
Change Theme, Dark/Light
Go to Spaces
Python
JavaScript
Java
C++
a = 0b1010 b = 0b0110 result = a | b print(bin(result)) #Python
const a = 0b1010; const b = 0b0110; const result = a | b; console.log(result.toString(2)); //JavaScript
public class Main { public static void main(String[] args) { int a = 0b1010; int b = 0b0110; int result = a | b; System.out.println(Integer.toBinaryString(result)); } } //Java
#include
#include
using namespace std; int main() { int a = 0b1010; int b = 0b0110; int result = a | b; cout << bitset<4>(result); return 0; } //C++
Python result:
JavaScript result:
Java result:
CPP result:
0b1110
1110
1110
1110