What is the value of y in the following code?
x=7;y=0;
if(x=6)
y=7;
else
y=1;
Answer Posted / piyush
its looks logically incorrect,but in c anc c++ if any such
incident occurs like if(x=6), this condition is always
treated as true
will give a warning ,but will execute this as considering
the if condition as true
ANSWER to this question is y=7
| Is This Answer Correct ? | 15 Yes | 0 No |
Post New Answer View All Answers
Why do we use header files in c?
Differentiate between static and dynamic modeling.
How many types of sorting are there in c?
What are directives in c?
Why we write conio h in c?
hi send me sample aptitude papers of cts?
How can a number be converted to a string?
Explain the red-black trees?
What are the advantages and disadvantages of a heap?
What are disadvantages of C language.
What does sizeof return c?
What is a node in c?
What is output redirection?
Why is c so popular?
What is cohesion and coupling in c?