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

different compiler gives different ans..

this is for tc
but its true it work as stack

last in first out
value of k is store in stack
1. k = 20
2. ++k = 21 (Pre Increment )
3. k++ = 21 (Post Increment(k value now is 22))
4. k = 22

As 22 is last it is printed 1st.........

Is This Answer Correct ?    0 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Is a house a shell structure?

1170


write an algorithm to display a square matrix.

2716


What is the basic structure of c?

1094


What is structure in c language?

1180


can we have joblib in a proc ?

2313


What is break in c?

1053


Is c is a middle level language?

1072


How can I get the current date or time of day in a c program?

1231


What are identifiers in c?

1207


7-Given an index k, return the kth row of the Pascal's triangle. For example, when k = 3, the row is [1,3,3,1]. For reference look at the following standard pascal’s triangle.

2763


Write a program to check palindrome number in c programming?

1028


What is the difference between NULL and NUL?

1308


The __________ attribute is used to announce variables based on definitions of columns in a table?

1216


Is it possible to have a function as a parameter in another function?

1086


What are the different types of constants?

1079