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 are enumerations in C
Describe how arrays can be passed to a user defined function
What is the best style for code layout in c?
On most computers additional memory that is accessed through an adapter of feature card along with a device driver program. a) user memory b) conventional memory c) expandedmemory d) area
What are type modifiers in c?
How is a structure member accessed?
What is a program flowchart and explain how does it help in writing a program?
how to solve "unable to open stdio.h and conio.h header files in windows 7 by using Dos-box software
How was c created?
Is swift based on c?
When would you use a pointer to a function?
What does d mean?
Explain function?
How do I convert a string to all upper or lower case?
What is a union?