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 / manish

output will be 1.

Is This Answer Correct ?    20 Yes 2 No

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

Answer / sanish joseph

hey guys ans is 1.
coz (0==0)retuns 1as it is true;

Is This Answer Correct ?    16 Yes 1 No

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

Answer / g.narsing

answer is 1 because (0==0)which is a true value
true=1

Is This Answer Correct ?    8 Yes 0 No

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

Answer / radha

it prints 1

Is This Answer Correct ?    8 Yes 1 No

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

Answer / ranjith

answer is 1

Is This Answer Correct ?    6 Yes 0 No

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

Answer / sumeet sharma

the ans is 1 because '==' operator on equality returns '1'
for true and returns '0' for false or inequality.

Is This Answer Correct ?    5 Yes 0 No

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

Answer / ankesh kumar

Output of this question will be 1,
becoz on comparision(0==0) it will print the value true ie
1.

Is This Answer Correct ?    3 Yes 0 No

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

Answer / vivek satasia

Every expression or functon in programming paradigm works on
TRUE means 1 or FAlSE means o value.Ex- u can check this,
Suppose u write function like clrscr().It also returns
value.U can store it's value in a variable and can print
that variable.Like this expressio is first evaluated in from
of 0 or 1.
Here expression is 0==0 which is tru so it returns 1.
So,ans=1.

Is This Answer Correct ?    1 Yes 0 No

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

Answer / rajendra

There is a possibility of getting "compilation error" .
because after cout statement we are not using any
conditional statements to check the above condition even
though it == is there ....

Is This Answer Correct ?    0 Yes 0 No

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

Answer / manimegalai

compiler error

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More OOPS Interview Questions

What is byval and byref? What are differences between them?

0 Answers   HCL, Wipro,


string is a class or data type in java?

3 Answers  


Why do we use virtual functions?

4 Answers  


how many types of notations are in java

1 Answers   National University of Modern Languages (NUML),


What is a scope operator and tell me its functionality?

3 Answers   emc2,






What is friend function?

12 Answers   Wipro,


where is memory for struct allocated? where is memory for class-object allocated? I replied for struct in stack and for class-object in heap. THen he asked if class has struct member variable what happens.class on heap and what about struct in that class? couldnt ans :( :-?

2 Answers   Infosys, Microsoft,


What is abstraction?

9 Answers  


Difference between over loading and over ridding?

12 Answers   CTS, Patni, Softvision Solution,


What is overloading and its types?

0 Answers  


What is the difference between the c++ & java?

2 Answers  


Program to check whether a word starts with a capital letter or not.

1 Answers   Infosys,


Categories