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 is polymorphism programming?

0 Answers  


Describe the difference between a Thread and a Process?

11 Answers   Siebel Systems,


Why multiple inheritance is not possible?

0 Answers  


Why do we need polymorphism in c#?

0 Answers  


Can you inherit a private class?

0 Answers  






Where You Can Use Interface in your Project

0 Answers   KPIT,


Are polymorphisms mutations?

0 Answers  


Why static functions always uses static variables?

3 Answers  


What is an interface in oop?

0 Answers  


1. Strong name 2. how to prevent a class from being inherited 3. delegates 4. default modifier for interface 5. default modifier for class 6. base class for exception 7. diff bet trigger and view in sql 8. how to exchange values from one page to another page 9. can multiple catch block ll be executed at same time 10. can u store different data types in an array & array list 11. when we ll use trigger 12. try,catch,finally usage

2 Answers  


143.what is oops principles?

10 Answers  


How Do you Code Composition and Aggregation in C++ ?

3 Answers   IBM, NET,


Categories