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
What is the difference between variable declaration and variable definition in c?
What are different types of operators?
What is pass by value in c?
which is conditional construct a) if statement b) switch statement c) while/for d) goto
When c language was developed?
Compare array data type to pointer data type
write a program to generate address labels using structures?
What is the sizeof () operator?
What is clrscr in c?
What is sizeof c?
Is stack a keyword in c?
What is difference between static and global variable in c?
Does c have class?
Where are c variables stored in memory?
What is struct node in c?