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 / ashwini

This gives an error. The error is as below:
error C2105: '++' needs l-value

if we correct the code to printf("%d", i++ + ++i);

We get the answer as 12...

The above printf becomes a statement when it sees the
semicolon. Unary operators have right to left associativity.
So, ++i is evaluated first to 6. Then, i++ is evaluated. i++
contributes 6 to addition and then increments i. So, we get
the answer as 12.

Is This Answer Correct ?    1 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

If the size of int data type is two bytes, what is the range of signed int data type?

1070


What is sorting in c plus plus?

1025


what is associativity explain what is the precidence for * and & , * and ++ how the folloing declaration work 1) *&p; 2) *p++;

2696


How can I call a function with an argument list built up at run time?

1287


`write a program to display the recomended action depends on a color of trafic light using nested if statments

2181


State two uses of pointers in C?

1108


What are pragmas and what are they good for?

1059


What are the different properties of variable number of arguments?

1204


What does calloc stand for?

1244


What is string in c language?

1249


a program that can input number of records and can view it again the record

1960


Is it possible to pass an entire structure to functions?

1053


any limit on the number of functions that might be present in a C program a) max 35 functions b) max 50 functions c) no limit d) none of the above

1104


What are predefined functions in c?

1156


When should you not use a type cast?

1181