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 is the output of below

int n=10;
(n++)++;
printf("%d",n);

Answers were Sorted based on User's Feedback



what is the output of below int n=10; (n++)++; printf("%d",n);..

Answer / abhijeet kankani

L-value required

Is This Answer Correct ?    22 Yes 1 No

what is the output of below int n=10; (n++)++; printf("%d",n);..

Answer / kirankumaryakkala

ans. error:Lvalue required
why? Lvalue means leftside assignment value,
here, first it goes to increment on N, again it is going to
increment, before going to increment second time, you should
allocate one varibale that holds the first time increment
value, other wise from where to it increment...

Is This Answer Correct ?    11 Yes 1 No

what is the output of below int n=10; (n++)++; printf("%d",n);..

Answer / deepak kumar

error : lvalue required.

n++ return 10 and after that n will increase to 1.
so now n=11
but next operation (postfix operator) is performing on
constant value 10 which is returned by (n++) operation.
it actually try to assign 11 to constant value 10. it is not
possible .
firstly we have to store it in a variable and then increment
can take place..

Is This Answer Correct ?    9 Yes 2 No

Post New Answer

More C Interview Questions

What are the functions to open and close file in c language?

0 Answers  


How we can insert comments in a c program?

0 Answers  


What happens if you free a pointer twice?

0 Answers  


When should a far pointer be used?

0 Answers   Aspire, Infogain,


Explain what will the preprocessor do for a program?

0 Answers  


what do you mean by inline function in C?

0 Answers   IBS, TCS,


What is a void * in c?

0 Answers  


What is %s and %d in c?

0 Answers  


what is the output on the screen? int n; n=printf("my name is %d",printf("kiran %d",printf("kumar"))); printf("\n %d \n",n);

4 Answers   TCS,


how the size of an integer is decided? - is it based on processor or compiler or OS?

19 Answers   HCL, JPR, Microsoft, nvidia,


I completed my B.tech (IT). Actually I want to develop virtual object that which will change software technology in the future. To develop virtual object what course I have to take. can I any professor to help me.

0 Answers   Oracle,


What is a C array and illustrate the how is it different from a list.

1 Answers   Amazon,


Categories