a=0;
b=(a=0)?2:3;
a) What will be the value of b? why
b) If in 1st stmt a=0 is replaced by -1, b=?
c) If in second stmt a=0 is replaced by -1, b=?

Answer Posted / syamkumarm

a)3
because it is ternery operator its work like a if.. else..
in the comdition part a=0 i.e. the result of expression is
zero so it goes to else part i.s 3

b)b=3

c)b=2

Is This Answer Correct ?    15 Yes 3 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

can we have joblib in a proc ?

1629


What is sizeof in c?

550


Explain what will be the outcome of the following conditional statement if the value of variable s is 10?

716


c program to compute AREA under integral

1776


write an algorithm to display a square matrix.

2188






What is the best way to store flag values in a program?

550


printf(), scanf() these are a) library functions b) userdefined functions c) system functions d) they are not functions

611


What is a constant?

610


What is scope rule in c?

573


Which is an example of a structural homology?

746


Define VARIABLE?

657


Explain b+ tree?

594


Explain built-in function?

568


What is dynamic dispatch in c++?

537


Is c programming hard?

553