What does the code "cout<<(0==0);" print?




1) 0


2) 1


3) Compiler error: Lvalue required

Answers were Sorted based on User's Feedback



What does the code "cout<<(0==0);" print? 1) 0 2) 1 3) Co..

Answer / sneha joshi.

There will be a compilation error as we are using "(" after insertion operator "<<". We are not assigning this value to any boolean typr variable, so we cant get answer as 0 or 1.

Is This Answer Correct ?    0 Yes 1 No

What does the code "cout<<(0==0);" print? 1) 0 2) 1 3) Co..

Answer / nitin gupta

the answer is 1 because of boolean ,if there is cout<<(0==1)
then the ans will be 0 and if there is cout<<"(0==0)" then
the ans is lvalue required

Is This Answer Correct ?    2 Yes 4 No

What does the code "cout<<(0==0);" print? 1) 0 2) 1 3) Co..

Answer / deepanker aggarwal

the answer is 0 guys

Is This Answer Correct ?    2 Yes 9 No

What does the code "cout<<(0==0);" print? 1) 0 2) 1 3) Co..

Answer / shailaja

it will print 0

Is This Answer Correct ?    4 Yes 13 No

What does the code "cout<<(0==0);" print? 1) 0 2) 1 3) Co..

Answer / guest

2

Is This Answer Correct ?    1 Yes 11 No

Post New Answer

More OOPS Interview Questions

What do we mean by a hidden argument in C++?

1 Answers  


what is static?

4 Answers  


what is the difference between virtual function and destoctor?

1 Answers  


What is polymorphism and example?

0 Answers  


Can destructor be overloaded?

0 Answers  






What is the difference between abstraction and polymorphism?

0 Answers  


Should you protect the global data in threads? Why or why not?

2 Answers   IBM,


What are the 3 pillars of oop?

0 Answers  


What is the difference between procedural programming and oops?

0 Answers  


what are the characteristics of oops?

7 Answers   NIIT,


How to handle exception in c++, For example in a functions i am assigning memory to some variables and also in next instructions in am dividing one variable also. If this functions generates a error while allocating memory to those variable and also while dividing the variable if i divide by zero then catch block how it will identify that this error has cone from perticular instruction

0 Answers  


What do you mean by pure virtual functions?

8 Answers  


Categories