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

answer is

22 21 21 20

printf .. executes from left hand side..


so first ..

printf("$d %d %d %d",k,K++,++k,k);

4.last k ie; 20
3.++k (pre) : 21
2.k++ (post) : 21 and then increamented
1.k : 22

answer is : 22 21 21 20

Is This Answer Correct ?    3 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the acronym for ansi?

1052


Explain union. What are its advantages?

1083


How do I send escape sequences to control a terminal or other device?

1084


What are enums in c?

1214


What is the most efficient way to count the number of bits which are set in an integer?

1070


Where register variables are stored in c?

973


What is the process to generate random numbers in c programming language?

1186


What are compound statements?

1188


Tell me is null always defined as 0(zero)?

1098


Describe the complexity of Binary search, Quicksort and various other sorting and searching techniques..

1043


How do you use a pointer to a function?

1095


What is a program flowchart?

1215


Distinguish between actual and formal arguments.

1088


Who is the founder of c language?

1174


What is linear search?

1146