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

Why can't we initialise member variable of a strucutre

1 Answers  


6)What would be the output? main() { int u=1,v=3; pf("%d%d",u,v); funct1(&u,&v); pf("%d%d\n",u,v); } void funct1(int *pu, int *pv) { *pu=0; *pv=0; return; } a)1 3 1 3 b)1 3 1 1 c)1 3 0 0 d)1 1 1 1 e) 3 1 3 1

4 Answers  


Explain the use of 'auto' keyword in c programming?

0 Answers  


What is meaning of "Void main" in C Language.

24 Answers   Ford, GU, HCL, IBIBS, JUW, TCS,


Print all numbers which has a certain digit in a certain position eg: number=45687 1 number=4 2 number=5 etc

4 Answers  


how can you print&scan anything using just one character? :) HINT: printf,scanf similer

2 Answers  


implement NAND gate logic in C code without using any bitwise operatior.

4 Answers   Alcatel,


Explain what is the difference between declaring a variable and defining a variable?

1 Answers  


What are the three constants used in c?

0 Answers  


What is hashing in c?

0 Answers  


develop algorithms to add polynomials (i) in one variable

0 Answers   Ignou, TCS,


void main() { char c; while(c=getchar()!='\n') printf("%d",c); } o/p=11 why?

8 Answers   Wipro,


Categories