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

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

Answer Posted / sravan kumer

Answer is 455848 in 'Turbo C++'
because here gave 4 %d's but given variables to print are 3.
So here Turbo C++ will evaluate first 3 parameters given as
---> first i will be evaluated so i=5 because printf() evaluates from right to left.
---> then i-- is 5 because it is post decrement so 1st prints value and then increments i=4
---> then i++ is post increments so 1st prints i value i.e 4
and then it will be incremented to 5.
---> so it printf will print 455 but there is another %d ,printf will handle those with a garbage values i.e 848 here.
so answer is 455848.i.e 455 is common after that some garbage value will be printed.

Is This Answer Correct ?    1 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the difference between c and python?

1155


Write a program to display all the prime nos from 1 to 1000000, your code should not take time more than a minute to display all the nos.

2055


Why header file is used in c?

1077


How do we open a binary file in Read/Write mode in C?

1231


Differentiate between declaring a variable and defining a variable?

1022


What does 2n 4c mean?

1218


Why void is used in c?

1004


What does the error message "DGROUP exceeds 64K" mean?

1210


How can you draw circles in C?

1144


Is it acceptable to declare/define a variable in a c header?

1099


the constant value in the case label is followed by a a) semicolon b) colon c) braces d) none of the above

1239


What are the properties of union in c?

1040


How can you read a directory in a C program?

1129


What is the use of a ‘’ character?

1064


Where does the name "C" come from, anyway?

1146