given
unsigned int ui1=3,ui2=7;
what are the outputs of
a)ui1 & ui2
b)ui1 && ui2
c)ui1 | ui2
d)ui1 || ui2

i also need the justification for the answers
thank you

Answers were Sorted based on User's Feedback



given unsigned int ui1=3,ui2=7; what are the outputs of a)ui1 & ui2 b)ui1 && ui2 ..

Answer / swapna

a) 3
&:bitwise and operator

3-011
7-111
3&7-011->3
b)any positive value
&&-logical and
both numbers are are positive.so and operation results in
true-so any positive value
c)7
bitwise or
d)any positive value
logical or

Is This Answer Correct ?    3 Yes 0 No

given unsigned int ui1=3,ui2=7; what are the outputs of a)ui1 & ui2 b)ui1 && ui2 ..

Answer / subeetha

a) 3
&:bitwise and operator

3-011
7-111
3&7-011->3
b)1
&&:logical and
both numbers are non zero.So, operation Result is true
c)7
bitwise or
d)1
&&:logical Or
both numbers are non zero.So, operation Result is true

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More C++ General Interview Questions

Show the application of a dynamic array with the help of an example.

0 Answers  


what are function pointers?

0 Answers  


given the code segment below void main() { cout<<"my no. is"; } question is how can we get the output hai aravind my no. is 99999999999 without editig the main().

2 Answers  


When one must use recursion function? Mention what happens when recursion functions are declared inline?

0 Answers  


What is the difference between #define debug 0 and #undef debug?

0 Answers  






What kind of jobs can I get with c++?

0 Answers  


What is unary operator? List out the different operators involved in the unary operator.

0 Answers  


Describe linked list using C++ with an example.

0 Answers  


Can we use pointers in c++?

0 Answers  


Does dev c++ support c++ 11?

0 Answers  


Write a program to get the value of sin (x) using a library function , when x is given in degrees.

1 Answers  


What is heap sort in c++?

0 Answers  


Categories