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

What is the advantage of an array over individual variables?

1248


Write a program to swap two numbers without using third variable?

1319


What is queue in c?

1112


What is 'bus error'?

1163


Write a C Program That Will Count The Number Of Even And Odd Integers In A Set using while loop

2170


When would you use a pointer to a function?

1057


Write a program for Overriding.

1168


What is the heap?

1226


What is the difference between typedef and #define?

1073


Why c is faster than c++?

1051


What is a buffer in c?

1014


What is the use of typedef in structure in c?

981


What are the 4 data types?

1030


What is the heap in c?

1093


Explain the difference between exit() and _exit() function?

1176