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

3 is the answer

2nd guy says we can't use "=" it's wroung we can use it in
this condition .


expl:

1st it will check condition part , condition part will
return false as, ANY VALUE OTHER THAN ZERO TAKEN AS TRUE IN
C LANGUAGE , here we are assiging zero to 'a' which give
false.


from basic of above contion , it condition return false it
will execute or return 2nd statement, i.e 3

so out put will be 3

Is This Answer Correct ?    7 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Why clrscr is used after variable declaration?

1765


why use "return" statement a) on executing the return statement it immediately transfers the control back to the calling program b) it returns the value present in the parentheses return, to the calling program c) a & b d) none of the above

1153


What are compound statements?

1245


How can you tell whether a program was compiled using c versus c++?

1163


What is anagram in c?

984


What is main return c?

1050


What is the maximum no. of arguments that can be given in a command line in C.?

1203


simple program of graphics and their output display

2052


List at least 10 sorting methods indicating their average case complexity, worst case complexity and best case complexity.

2799


What is the difference between the expression “++a” and “a++”?

1275


write a c program to find the largest and 2nd largest numbers from the given n numbers without using arrays

2291


Explain what is wrong in this statement?

1178


What is the difference between malloc() and calloc() function in c language?

1140


What does typedef struct mean?

1172


How do I send escape sequences to control a terminal or other device?

1123