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

to remove the repeated numbers from the given . i.e.., if the input is 12233 output should of 123

2 Answers  


What is the differances between a abstract calss and interface

5 Answers   Aviva, Symphony,


how to tackle technical questions

1 Answers  


can we make a class static without using static keyword?

5 Answers   Aspire,


What does no cap mean?

0 Answers  


They started with the brief introduction followed by few basic C++ questions on polumorphism, inheritance and then virtual functions. What is polymorphims? How you will access polymorphic functions in C? How virtual function mechanism works?

0 Answers  


Can we have inheritance without polymorphism?

0 Answers  


What is oops concept with example?

0 Answers  


What is polymorphism what is it for and how is it used?

0 Answers  


i had specified the access specifier for abstarct class member like (pure virtual function) as private.But it can be accessed by the derived class.How the private member of one class is accessed by other class.if any body face this problem and found the solution plz reply to me.

1 Answers   Syntel,


what is object oriented programming and procedure oriented programming?

3 Answers  


Program to print 0 to 9 in cross order

3 Answers  


Categories