According to boolean algebra, 5 is equivalent to 101 in binary. And 3 is equivalent to 011. So if we calculate 101 | 011 then it should be 1000 which is equivalent to 2^3 = 8 but in vs code the compiler gives 7, is there any error in my solution?
What is the value of 5 | 3 in C?
1.9k Views Asked by Arijit Ghosh At
2
There are 2 best solutions below
Related Questions in C
- How to call a C language function from x86 assembly code?
- What does: "char *argv[]" mean?
- User input sanitization program, which takes a specific amount of arguments and passes the execution to a bash script
- How to crop a BMP image in half using C
- How can I get the difference in minutes between two dates and hours?
- Why will this code compile although it defines two variables with the same name?
- Compiling eBPF program in Docker fails due to missing '__u64' type
- Why can't I use the file pointer after the first read attempt fails?
- #include Header files in C with definition too
- OpenCV2 on CLion
- What is causing the store latency in this program?
- How to refer to the filepath of test data in test sourcecode?
- 9 Digit Addresses in Hexadecimal System in MacOS
- My server TCP doesn't receive messages from the client in C
- Printing the characters obtained from the array s using printf?
Related Questions in BITWISE-OPERATORS
- How to remove option from bit wise operation
- Negate every bit value of a binary in C
- AVX512 perform AND of 512bits of 8-bit chars
- Minimizing the number of basic arithmetic/binary operators needed to arrive at all others
- How to calculate left shift for big powers?
- The difference between (x^y) and !(!(x^y))
- Difference between logical "and" and bit wise &
- Lua 5.1 bitwise operations using arithmetic for 64bit numbers
- Why do x&1==0 and !(x&1) not yield the same results in an if statement in C++?
- How many additions operation can be performed instead of single multiplication in FPGA?
- Bitwise Reduction Operators in C
- How does python enable bitwise operators without an integer bit limit
- Major Speedup Question for a for loop in Pandas/Numpy on a bitwise_xor accumulate
- Why does Python return 0 for this & operation?
- Sign extending bit shifted binary values in C++ using only bitwise operators
Related Questions in BOOLEAN-LOGIC
- how do we represent the expression x+y'+z' in into one which can be represented using only NANDs (i.e. negations of products)
- LC-3 Assembly OR operation
- I am new to Boolean Algebra, and i need advice
- How do I modify this .hdl chip to fulfill the question's requirements? (boolean logic / nand2tetris)
- How the logical operators works in java?
- My TempArray always has the wrong values and therefore doesnt evaluate properly and I am confused why
- How do I get this code to accommodate any given number by only using boolean logic (no conditionals/ functions)
- Trouble with boolean logic in if (else) statements
- How to make an alert show up when the page won't load AND it's been 7 seconds
- Derive conditions for each variable assignment from pseudocode
- Problems with Drag and Drop system in Unity
- How to output a 5 bit number from a ripple-carry adder/subtractor into a 5 bit decoder to account for overflow in Verilog?
- Most optimal way of running intensive math calculations on a GPU
- What language uses `and` and `or` keywords to mean "do this thing without affecting the result"?
- Change boolean in ajax in ASP.NET MVC
Related Questions in BITWISE-OR
- LC-3 Assembly OR operation
- how to perform bit wise "or" operation with same value/ variable?
- Nibble_Swap or Swapping 0x1234
- Groovy regex syntax regarding OR operator
- what happens if we compare unsigned short int and unsigned char (comparing the bits)? (in C language)
- a |= (1 << 31) results in unexepected value
- How to make competitive coding solutions more efficient (BIT wise operations)?
- How to insert a new Bit at MSB and ignoring all other bits
- Is there any way to shorten if statement with bitwise or?
- bitwise logical operator on enum list
- TypeScript equivalent of `u32` numerical suffix
- find smallest whole number missing form bitwise OR of all the subsequence of given array?
- What is the value of 5 | 3 in C?
- Invert a value of bit in digit
- difference between bitwise and logical OR
Trending Questions
- UIImageView Frame Doesn't Reflect Constraints
- Is it possible to use adb commands to click on a view by finding its ID?
- How to create a new web character symbol recognizable by html/javascript?
- Why isn't my CSS3 animation smooth in Google Chrome (but very smooth on other browsers)?
- Heap Gives Page Fault
- Connect ffmpeg to Visual Studio 2008
- Both Object- and ValueAnimator jumps when Duration is set above API LvL 24
- How to avoid default initialization of objects in std::vector?
- second argument of the command line arguments in a format other than char** argv or char* argv[]
- How to improve efficiency of algorithm which generates next lexicographic permutation?
- Navigating to the another actvity app getting crash in android
- How to read the particular message format in android and store in sqlite database?
- Resetting inventory status after order is cancelled
- Efficiently compute powers of X in SSE/AVX
- Insert into an external database using ajax and php : POST 500 (Internal Server Error)
Popular # Hahtags
Popular Questions
- How do I undo the most recent local commits in Git?
- How can I remove a specific item from an array in JavaScript?
- How do I delete a Git branch locally and remotely?
- Find all files containing a specific text (string) on Linux?
- How do I revert a Git repository to a previous commit?
- How do I create an HTML button that acts like a link?
- How do I check out a remote Git branch?
- How do I force "git pull" to overwrite local files?
- How do I list all files of a directory?
- How to check whether a string contains a substring in JavaScript?
- How do I redirect to another webpage?
- How can I iterate over rows in a Pandas DataFrame?
- How do I convert a String to an int in Java?
- Does Python have a string 'contains' substring method?
- How do I check if a string contains a specific word?
According to the C Standard (6.5.12 Bitwise inclusive OR operator)
So you have