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
How can you increase the size of a dynamically allocated array?
C program to find all possible outcomes of a dice?
What is the difference between the expression “++a” and “a++”?
in any language the sound structure of that language depends on its a) character set, input/output function, its control structures b) character set, library functions, input/output functions its control structures c) character set, library functions, control sturctures d) character set, operators, its control structures
What is typeof in c?
What is ## preprocessor operator in c?
How many parameters should a function have?
Which control loop is recommended if you have to execute set of statements for fixed number of times?
what is recursion in C
Can you please explain the difference between malloc() and calloc() function?
What is a void pointer in c?
If a variable is a pointer to a structure, then which operator is used to access data members of the structure through the pointer variable?
Explain b+ tree?
Explain how can type-insensitive macros be created?
Is c dynamically typed?