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

how many types of operators are include in c language a) 4 b) 6 c) 8 d) 12

1060


What is the use of #define preprocessor in c?

1054


What is the easiest sorting method to use?

1142


What is string concatenation in c?

1076


Is c high or low level?

992


Explain what is the use of a semicolon (;) at the end of every program statement?

1214


What is sizeof array?

1038


What is the collection of communication lines and routers called?

1105


Explain how can type-insensitive macros be created?

980


in multiple branching construct "default" case is a) optional b) compulsarily c) it is not include in this construct d) none of the above

1044


What should malloc() do? Return a null pointer or a pointer to 0 bytes?

1057


How can you tell whether a program was compiled using c versus c++?

1089


What is meant by preprocessor in c?

994


What is the use of getchar functions?

1168


What is the use of a conditional inclusion statement in C?

1043