Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

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 / vignesh1988i

the value is 0 so this will go to 3.. the value of b=3
a) b=3... since we are not comparing the value os a's...
this is an assignment statement.... so a itself is 0, which
is an false condition.... so it moves to 3

b) the value of b=2... since -1 ia an non zero value... the
whole term wil become true....

c) b=2... same reson as above

actually the above conditional operater statement must be
full y enclosed witin braces.... then only we should assign
to a variable....

Is This Answer Correct ?    4 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Write a programme using structure that create a record of students. The user allow to add a record and delete a record and also show the records in ascending order.

2039


What are the primitive data types in c?

1007


How can I sort a linked list?

973


In C programming, what command or code can be used to determine if a number of odd or even?

990


Why c language?

1006


What are the types of c language?

976


hello freinds next week my interview in reliance,nybody has an idea about it intervew questions..so tell

2136


What is the significance of c program algorithms?

1098


Is flag a keyword in c?

1109


Explain a pre-processor and its advantages.

1073


Are negative numbers true in c?

1001


What will the preprocessor do for a program?

1017


What does malloc () calloc () realloc () free () do?

1003


the real constant in c can be expressed in which of the following forms a) fractional form only b) exponential form only c) ascii form only d) both a and b

2614


Why c is called a mid level programming language?

1023