Hello and welcome to Java T Point. And today the discussion is on C output based questions we were we were discussing about C output
based question series and in that we will discuss bit wise operators fine. So let's start with bit wise operator question
So this is one of the really important questions and quite confusing too. So in this given question
what will be the output that what will be the output of the following code? Fine. Here we are using two bit wise operator
One is and, and one you are using R fine. So what is and hope you have a knowledge of and gate
So what is and gate and gate is something like that? If one of the input is zero
you will 100% get output zero. That is if one of the input is false
you will get output as a false. And it uses method of multiply
it uses method of multiply fine. OK? Because of that, if suppose this is one
so 0 to 1, you will get zero. If suppose this is one and this is zero, you will get 10
So this that and if both are zero and then also you will get zero. But if both are one
so one into one, you will get one. So that is what I'm saying. If one of the input is zero
you will 100% get our output as zero. But what about org or it looks like this
if one of the input is 100% you will get output one. If one of the input is true
you will get 100% output. One means true, you will get out. Output is a true
It applies a method fine add. So uh this is what uh and gate is all about
So keeping this particular concept in mind, we'll start solving the question fine
So let's start solving the cushion. Let me rub all these things so that I have a space to solve the question
So let's solve the cus you have even A is 18, B is 38 and C is 56 fine
Now in if condition you have a device operator B greater than C
So first of all, you will solve this bracket first. So is B greater than CB is 38 and what is CC is 56
So is 38 greater than 56. No false false means what? Zero
And you are ending A with zero, what is a 18, right? 18 10010
This is binary of 18. You are ordering with zero. So when you are ring with zero
That is 00000. ring ending ending with ending, I'm sorry. Ending ending means multiply
I just told you ended zero to 0000 to 000. So finally what answer you are getting zero
So the complete answer of this is finally zero. The complete answer of this is zero means what false zero means what false false
You will not execute this statement, you will not execute this statement
You will jump to Lle now now again, come and solve this question is a greater than C what is a 18
is 18? Greater than 56? No condition is false. False means zero
Now you, you are ring, you are ring zero with you R zero with 5656 whatever
I'm not converting 56 to binary because I know uh R means addition
So zero R 56 we'll definitely give you 56 because what is R 56 when you add uh zero
And in binary of 56 plus when you plus zero, wi it is not going to hamper it is not going to change any value
So you will finally get 56. So the answer, what is the complete answer of this would be
What? 56 and 56 is what true? 56 is what true. The moment it becomes true
you will execute this statement and what you are printing, you are printing B what is B 38
So I, I suppose you should get the answer. 38. Let's see the answer
Yes, exactly. So answer is 38. Hope you have understood what I was trying to tell you while solving this question
So while solving this question, you have to keep in mind and get property and or gate property
If you keep this particular thing in your mind, definitely you will able to solve the question very well
So this was all about today's uh question of uh bit wise operator
So at last I'll say thank you so much for watching Java Point. Please like subscribe and share the channel
Thank you. Thank you so much