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

void main()
{
int i=5;
printf("%d",i+++++i);
}

Answer Posted / sheetal

gives error
"error C2105: '++' needs l-value"
because it parses above expression in "((i++)++)+i), so in
2nd unary operator it searches for l-value.
If we modify above pgm into following way:-
void main()
{
int i=5;
printf("%d",((i++)+(++i)));
}
it will give answer 12.
because once last pre-unary increment operator is operated,
i is incremented to 6 and 6+6 = 12.
if we put one more print for i's value, it will give i =7.
because first post-increment operator is operated after
first printf statement as follows.
void main()
{
int i=5;
printf("%d",((i++)+(++i)));
printf("%d\n",i); // ===> i =7
}

Is This Answer Correct ?    4 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the advantage of using #define to declare a constant?

1096


Which is better malloc or calloc?

1100


What are types of functions?

1040


The file stdio.h, what does it contain?

1160


what do you mean by inline function in C?

1056


List a few unconditional control statement in c.

985


Does c have function or method?

997


What is the use of header?

1091


What are the 4 data types?

1018


Why do we use & in c?

1001


write a program to convert a expression in polish notation(postfix) to inline(normal) something like make 723+* (2+3) x 7 (not sure) just check out its mainly printing expression in postfix form to infix.

3967


What are unions in c?

1028


What are the rules for identifiers in c?

1066


Is it possible to pass an entire structure to functions?

998


Q.1 write a program to create binary tree 1 to 16 numbers? Q.2 write a program to creat a binary search tree for the member that is given by user?

2545