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
Answer / sanish joseph
hey guys ans is 1.
coz (0==0)retuns 1as it is true;
Is This Answer Correct ? | 16 Yes | 1 No |
Answer / g.narsing
answer is 1 because (0==0)which is a true value
true=1
Is This Answer Correct ? | 8 Yes | 0 No |
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 |
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 |
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 are functions in oop?
WILL I GET A guaranteed JOB AFTER DOING bsc()IT) and GNIIT from an NIIT CENTRE??
21 Answers Biocon, MIT, NIIT,
Program to check whether a word is the first word of the sentence.
#include <iostream> using namespace std; int main() { int a = 3; int c[5][5]; for (int x=0;x<5;x++) { for (int y=0;y<5;y++) { c[x][y] = x*y; } } cout << c[a][2]; }
what is data abstraction with example.
What does I oop mean?
What are the three main types of variables?
define a string class. overload the operator == to compare two strings
2 Answers Birla, Ericsson, HCL, Infosys, Infotech, MCAS, Satyam,
What is abstraction and encapsulation?
What is a template?
what is the function of 'this' operator ?
What is abstraction encapsulation?