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 formal argument?
What is the use of #define preprocessor in c?
Which are low level languages?
How macro execution is faster than function ?
Compare array data type to pointer data type
How pointers are declared?
How can I direct output to the printer?
What is the method to save data in stack data structure type?
What is the stack in c?
What are the advantages of Macro over function?
What is unsigned int in c?
What is a macro?
what do the 'c' and 'v' in argc and argv stand for?
If one class contains another class as a member, in what order are the two class constructors called a) Constructor for the member class is called first b) Constructor for the member class is called second c) Only one of the constructors is called d) all of the above
What is this pointer in c plus plus?