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
pierrot's divisor program using c or c++ code
Write a program on swapping (100, 50)
What does node * mean?
application areas a 'c' a) operating system b) graphics, interpreter, assembler c) program evalution, communication softwares d) all the above
Which is the best website to learn c programming?
Write a program to check armstrong number in c?
What is the meaning of && in c?
Explain spaghetti programming?
What is the use of c language in real life?
how can i access hard disk address(physical address)? are we access hard disk by using far,near or huge pointer? if yes then please explain.....
What is a char c?
What are the 5 types of organizational structures?
Explain what are the advantages and disadvantages of a heap?
What are the features of c language?
Is there anything like an ifdef for typedefs?