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

what is the output for this question:
main()
{
int i=1;
printf("%d%d%d",i,i++,++i);
}

Answer Posted / sumalatha

Ans is 2 2 2
because in printf assosiativity is from left to right
first pre increments i that becomes 2 next post increment
is done after printf stmt so prints 2 again, then simple
print i i.e 2again
last post increnent which i becomes 3 but that is done
after printf stmt

Is This Answer Correct ?    1 Yes 4 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

swap 2 numbers without using third variable?

1129


Explain what is the stack?

1099


How many keywords (reserve words) are in c?

1142


How can you invoke another program from within a C program?

1073


What is meant by operator precedence?

1144


GIven a sequence of characters. How will you convert the lower case characters to upper case characters. ( Try using bit vector - sol given in the C lib -> typec.h)

1097


What are identifiers and keywords in c?

1098


How can I make sure that my program is the only one accessing a file?

1267


What is the use of pragma in embedded c?

1055


What is the difference between struct and typedef struct in c?

1128


Is fortran still used today?

1091


What is the meaning of 2d in c?

1125


In a switch statement, explain what will happen if a break statement is omitted?

1070


Why static variable is used in c?

1036


What does the c in ctime mean?

1090