What is the value of y in the following code?
x=7;y=0;
if(x=6)
y=7;
else
y=1;
Answer Posted / gg
Ans: 7
Coz all non-zero statements are treated as true.
code can be written as..
if(TRUE)/*x=6 is a non-zero*/
Y=7;
else
y=1;
Note: To compare,have to use '==' operator.'=' is an
assignment operator.
| Is This Answer Correct ? | 12 Yes | 0 No |
Post New Answer View All Answers
What is int main () in c?
What is malloc return c?
What are valid operations on pointers?
What is the size of enum in bytes?
Explain what are bus errors, memory faults, and core dumps?
Tell me the use of bit field in c language?
What are pointers?
What is the time and space complexities of merge sort and when is it preferred over quick sort?
how to write optimum code to divide a 50 digit number with a 25 digit number??
which type of aspect you want from the student.
Why is c not oop?
how many key words availabel in c a) 28 b) 31 c) 32
Why do we use namespace feature?
What is the difference between the expression “++a” and “a++”?
What is meant by errors and debugging?