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

You have two pairs: new() and delete() and another pair : alloc() and free(). Explain differences between eg. New() and malloc()

0 Answers  


What are c++ tokens?

0 Answers  


Explain what are the sizes and ranges of the basic c++ data types?

0 Answers  


Show the declaration for a static member variable.

0 Answers  


What is c++ 11 and c++ 14?

0 Answers  






Can we make any program in c++ without using any header file and what is the shortest program in c++.

0 Answers   MCN Solutions,


What do you mean by static variables?

0 Answers  


What is a terminating character in c++?

0 Answers  


What does I ++ mean in c++?

0 Answers  


What is the keyword auto for?

0 Answers  


differance between copy & clon

1 Answers   Microsoft,


Write about the scope resolution operator?

0 Answers  


Categories