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 |
features of OOPS
22 Answers Ness Technologies, Satyam,
String = "C++ is an object oriented programming language.An imp feature of oops is classes and objects".Write a pgm to count the repeated words from this scenario?
What do we mean by a hidden argument in C++?
#include <stdio.h> #include <alloc.h> #include <stdlib.h> #include <conio.h> void insert(struct btreenode **, int); void inorder(struct btreenode *); struct btreenode { struct btreenode *leftchild; struct btreenode *rightchild; int data; }; main() { struct btreenode *bt; bt=(struct btreenode *)NULL; int req,i=1,num; clrscr(); printf("Enter number of nodes"); scanf("%d",&req); while(i<=req) { printf("Enter element"); scanf("%d",&num); insert(&bt,num); i++; } inorder(bt); } void insert(struct btreenode **sr, int num) { if(*sr==NULL) { *sr=(struct btreenode *)malloc (sizeof(struct btreenode)); (*sr)->leftchild=(struct btreenode *)NULL; (*sr)->rightchild=(struct btreenode *)NULL; (*sr)->data=num; return; } else { if(num < (*sr)->data) insert(&(*sr)->leftchild,num); else insert(&(*sr)->rightchild,num); } return; } void inorder(struct btreenode *sr) { if(sr!=(struct btreenode *)NULL) { inorder(sr->leftchild); printf("\n %d",sr->data); inorder(sr->rightchild); } else return; } please Modify the given program and add two methods for post order and pre order traversals.
What is the use of oops?
What is object and example?
What is encapsulation in oop?
What is a unary operator?
wht is ditch
Is abstract thinking intelligence?
Write an operator overloading program to write S3+=S2.
Write a c++ program to display pass and fail for three student using static member function