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
What happens if header file is included twice?
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
Can you mix old-style and new-style function syntax?
What is the use of getchar() function?
In c programming, explain how do you insert quote characters (? And ?) Into the output screen?
Are pointers really faster than arrays?
Can a pointer be null?
Is it valid to address one element beyond the end of an array?
Describe static function with its usage?
What do you mean by recursion in c?
application attempts to perform an operation?
What is an lvalue in c?
What does c value mean?
What is the use of getchar functions?
How many types of functions are there in c?