int a=0,b=2;
if (a=0)
b=0;
else
b=*10;
What is the value of b ?
Answer Posted / kc
The code will not compile as statement "b=*10" is invalid"
It should be "b*=10".
If i assume "b*=10" then the output will be 20
Reason:
a=0;
b=2;
if(a=0 means 0) so b=0 will not execute
b=b*10=2=10=20;
Is This Answer Correct ? | 37 Yes | 6 No |
Post New Answer View All Answers
How can I copy just a portion of a string?
How do we declare variables in c?
Explain high-order bytes.
What are the 5 types of organizational structures?
What is an auto variable in c?
What is the sizeof () operator?
What does #pragma once mean?
What is wrong with this program statement?
What is scope of variable in c?
why arguments can generally be passed to functions a) sending the values of the arguments b) sending the addresses of the arguments c) a & b d) none of the above
When would you use a pointer to a function?
Explain how do you print an address?
Write a code on reverse string and its complexity.
Differentiate between the = symbol and == symbol?
What does %d do in c?