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


Please Help Members By Posting Answers For Below Questions

How can I copy just a portion of a string?

815


How do we declare variables in c?

569


Explain high-order bytes.

676


What are the 5 types of organizational structures?

550


What is an auto variable in c?

758






What is the sizeof () operator?

624


What does #pragma once mean?

686


What is wrong with this program statement?

610


What is scope of variable in c?

567


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

645


When would you use a pointer to a function?

589


Explain how do you print an address?

659


Write a code on reverse string and its complexity.

608


Differentiate between the = symbol and == symbol?

713


What does %d do in c?

544