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


#include<stdio.h>
main()
{ int i=5;
printf("%d",i*i-- - --i*i*i++ + ++i);

}

tell the answer with correct reason .specially reason is
important nt answer
ans by turbo c is -39



#include<stdio.h> main() { int i=5; printf("%d",i*i-- - --i*i*i++ + ++i); ..

Answer / myname

It it not an easy question.

After investigating it a little bit, I would say:

- It is undefined behaviour, since "i" is being modified more than once between two sequence points.
- I bet that the turbo c answer is not -39, but -34 (5*5 - 4*4*4 + 5) = -34 (not important, anyway, since any other compiler can reorder the operations and give you any other result since, as I have previously said, it is undefined behaviour).

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More C Interview Questions

Q. where is the below variables stored ? - volatile, static, register

3 Answers   Bosch,


Explain pointer. What are function pointers in C?

0 Answers   HCL,


What are the two types of functions in c?

0 Answers  


what is the value of 'i'? i=strlen("Blue")+strlen("People")/strlen("Red")-strlen("green")

7 Answers   Cadence, JNTU, Zen Technologies,


is it possible to change the default calling convention in c ?

1 Answers   Aptech,


which operator having highest precedence? a.)+ b.)++ c.)= d.)%

4 Answers  


1,1,5,17,61,217,?,?.

3 Answers   Apple,


What are lookup tables in c?

0 Answers  


write a c program that prints all multiples of 3between 1 and 50.

5 Answers  


What is d'n in c?

0 Answers  


How do you generate random numbers in C?

0 Answers  


How to print "I Love My India" without using semi colon?

4 Answers  


Categories