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

20 20 22 22
solution

1) k corresponds to 20 20
2) k++ corresponds to k = k then k+1 20

after assignment k becomes 21

3) ++k corresponds to k + 1 then k = k 22
4) k corresponds to k 22

Is This Answer Correct ?    3 Yes 4 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is const and volatile in c?

1097


What is the difference between exit() and _exit() function?

1101


Can a variable be both constant and volatile?

1183


Can we compile a program without main() function?

1181


How can I write a function analogous to scanf?

1233


c program for searching a student details among 10 student details

2141


Explain spaghetti programming?

1321


provide an example of the Group by clause, when would you use this clause

2246


Explain bitwise shift operators?

1317


What is restrict keyword in c?

1169


Why is c called "mother" language?

1333


How to delete a node from linked list w/o using collectons?

2825


What are the different data types in C?

1249


the question is that what you have been doing all these periods (one year gap)

2140


How can I prevent another program from modifying part of a file that I am modifying?

1110