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 sizeof int?
what are non standard function in c
Are the variables argc and argv are always local to main?
How to Throw some light on the splay trees?
Given an array of 1s and 0s arrange the 1s together and 0s together in a single scan of the array. Optimize the boundary conditions?
Does * p ++ increment p or what it points to?
Why does this code crash?
Where are local variables stored in c?
Which is better pointer or array?
Write a function stroverlap that takes (at least) two strings, and concatenates them, but does not duplicate any overlap. You only need to worry about overlaps between the end of the first string and the beginning of the second string. Examples: batman, manonthemoon = batmanonthemoon batmmamaman, mamamanonthemoon = batmmamamanonthemoon bat, man = batman batman, batman = batman batman, menonthemoon = batmanmenonthemoon
What are the advantages of using Unions?
how do you execute a c program in unix.
How can I determine whether a machines byte order is big-endian or little-endian?
What are loops c?
Can include files be nested? How many levels deep can include files be nested?