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 WILL BE OUTPUT OF BELOW CODE . . AND PLEASE EXPLAIN HOW
IT COME ..

#include<stdio.h>
#include<conio.h>
void main()
{
int k=20;
printf("%d%d%d%d",k,k++,++k,k);
getch();
}

Answer Posted / anand

The answer should be 22212120
Arguments passed to the printf statement would get executed
from the right to left..
1. k = 20
2. ++k = 21 (Pre Increment)
3. k++ = 21 (Post Increment(k value now is 22))
4. k = 22
Thus the output : 22212120

Is This Answer Correct ?    1 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Why n++ execute faster than n+1 ?

3142


Explain how can I convert a number to a string?

1205


What is conio h in c?

1094


Explain do array subscripts always start with zero?

1282


What is the difference between a string copy (strcpy) and a memory copy (memcpy)? When should each be used?

1184


Write a C Program That Will Count The Number Of Even And Odd Integers In A Set using while loop

2204


Where local variables are stored in c?

1045


What are the features of c language?

1120


What is a char c?

1085


How to establish connection with oracle database software from c language?

2255


How can you determine the maximum value that a numeric variable can hold?

1293


How are structure passing and returning implemented?

1085


What is the advantage of a random access file?

1251


Is boolean a datatype in c?

1126


Explain data types & how many data types supported by c?

1131