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

please give me answer with details
#include<stdio.h>
main()
{
int i=1;
i=(++i)*(++i)*(++i);
printf("%d",i);
getch();
}

Answer Posted / joe

The precedence of the operations, should be (reading from
left to right in the equation)

++i <first ++i i=2>
++i <second ++i i=3>
* <first product yields 3*3=9>
++i <third ++i i=4>
* <giving the second product 3*4=36>

Thus, the first product (*) is computed before the third ++i
is computed. Once the first product is completed, i is
incremented to i=4 and the second product can occur now.


Now, if you add some parentheses to the expression giving

++i * (++i * ++i)

then you will get 64, as the other replies suggest. Tracing
through the order of operations in this one

++i <first ++i i=2>
++i <second ++I i=3>
++i <third ++I i=4>
* <the product in the parentheses now yields 4*4=16>
* <the first * yields 4*16=64>

Here, the first product (*) cannot occur until it knows the
result of the product in the parenthesis. Thus, all three
increments must occur before the multiplications take place.

Is This Answer Correct ?    13 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is a null string in c?

1001


Explain the advantages of using macro in c language?

966


Explain how can I open a file so that other programs can update it at the same time?

1070


how can i access hard disk address(physical address)? are we access hard disk by using far,near or huge pointer? if yes then please explain.....

1757


What are data types in c language?

1022


What is the purpose of the preprocessor directive error?

1217


What does struct node * mean?

982


Given two strings S1 and S2. Delete from S2 all those characters which occur in S1 also and finally create a clean S2 with the relevant characters deleted.

1375


Can a local variable be volatile in c?

959


Explain null pointer.

1055


What is the difference between mpi and openmp?

1233


Explain indirection?

1071


What is the difference between union and structure in c?

1107


Differentiate between null and void pointers.

1131


What are the key features in c programming language?

1025