What is the value of y in the following code?
x=7;y=0;
if(x=6)
y=7;
else
y=1;
Answer Posted / balaji jayakumar
y=7 because if condition doesnt fail... so the immediate
statement after if will be executed and 7 gets printed. It
is quite certain only if "if" fails else will be be opted
for. so y=7... no error statements will occur.. i have tried
it in c.
| Is This Answer Correct ? | 3 Yes | 0 No |
Post New Answer View All Answers
Can I initialize unions?
What are local variables c?
What is equivalent to ++i+++j?
WHAT IS THE DEFINATION OF IN TECHNOLOGY AND OFF TECHNOLOGY ?
What is the explanation for modular programming?
What are the applications of c language?
What are nested functions in c?
7-Given an index k, return the kth row of the Pascal's triangle. For example, when k = 3, the row is [1,3,3,1]. For reference look at the following standard pascal’s triangle.
What kind of structure is a house?
When should structures be passed by values or by references?
How does #define work?
What is the package for freshers(Non IIT) in amazon(hyderabad). And what is the same for those who are a contract employee.
What are near, far and huge pointers?
What is scope rule of function in c?
What is openmp in c?