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

main()
{ int i;
printf("%d",((i=1)*i-- - --i*(i=-3)*i++ + ++i));

}

ans is 24 bt how?pls tell smbody............

Answer Posted / gorgeousgirl

Answer: 34
confirm the answer with http://codepad.org/PudiZIaS
Explanation:
by order of precedence, parenthesis hav highest priority
so
(i=1)*i-- - --i*(i=-3)*i++ + ++i
i=1 i=-3
now, i=-3
after assignment operations the expr becomes,
>(i)*i-- - --i*(i)*i++ + ++i
next higher priority is for auto-in/decrement
omitting post in/decrement(as they hav effect only after
this line of code), we get,
> i*i - --i*i*i + ++i
the associativity for printf statement is from right to left
so ++i is executed first before --i where i=-3
> i*i - --i*i*i + -2
now i=-2
> i*i - -3*i*i + -2
now i =-3
next precedence is for multiplication
> -3*-3
-
-3*-3*-3
+
-2
> 9 - -27 + -2
> 9 + 27 -2
> 9 + 25
> 34

Is This Answer Correct ?    3 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is volatile variable how do you declare it?

1027


What are the advantages and disadvantages of c language?

962


What is meant by gets in c?

1103


Can the “if” function be used in comparing strings?

982


What is equivalent to ++i+++j?

1040


Write a C program to count the number of email on text

1854


What Is The Difference Between Null And Void Pointer?

1156


Give differences between - new and malloc() , delete and free() ?

1045


Using functions, write a program that multiplies two arrays. Use the following functions: - Function ReadArray - Function MultiplyArrays - Function DisplayArrays

2299


What are the rules for identifiers in c?

1029


Explain what header files do I need in order to define the standard library functions I use?

1115


What are identifiers c?

1020


in linking some of os executables are linking name some of them

2075


how we can make 3d venturing graphics on outer interface

4731


What is the explanation for modular programming?

1148