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

please can any one suggest me best useful video tutorials on c i am science graduate.please help me.u can email me to sas29@in.com

1323


write a c program to print the next of a particular no without using the arithmetic operator or looping statements?

3180


What is the symbol indicated the c-preprocessor?

693


What does the error 'Null Pointer Assignment' mean and what causes this error?

739


Do string constants represent numerical values?

918






What is the difference between exit() and _exit() function in c?

578


What is the meaning of typedef struct in c?

592


A character flag or control mechanism that delineates one data item from another a) variable b) constant c) delimiter d) call by reference

629


Why & is used in c?

711


Differentiate between the expression “++a” and “a++”?

697


What is p in text message?

537


Differentiate between a structure and a union.

758


Wt are the Buses in C Language

2749


What is an auto variable in c?

750


What are local variables c?

548