void main()
{
int i=5;
printf("%d",i++ + ++i);
}

Answers were Sorted based on User's Feedback



void main() { int i=5; printf("%d",i++ + ++i); }..

Answer / sachin

ans :11
how?
-> i++ => i=i+1 => i=6;

-> ++i => i=i =>i=5(first assign the value);
i=i+1;

so i++ + ++i=6 + 5=11 i.e.ans

Is This Answer Correct ?    3 Yes 31 No

Post New Answer

More C Interview Questions

declare afunction pointer to int printf(char *)?

1 Answers   HCL,


How can you access memory located at a certain address?

0 Answers  


What is c language & why it is used?

0 Answers  


Can include files be nested? How many levels deep can include files be nested?

0 Answers   Aspire, Infogain,


what is call by value and call by reference

4 Answers  






What will be result of the following program? void myalloc(char *x, int n) { x= (char *)malloc(n*sizeof(char)); memset(x,\0,n*sizeof(char)); } main() { char *g="String"; myalloc(g,20); strcpy(g,"Oldstring"); printf("The string is %s",g); } a) The string is : String b) Run time error/Core dump c) The string is : Oldstring d) Syntax error during compilation e) None of these

3 Answers   IBM,


Is there any demerits of using pointer?

0 Answers  


What is const keyword in c?

0 Answers  


What is the use of define in c?

0 Answers  


Do you know the difference between exit() and _exit() function in c?

0 Answers  


Explain what is the stack?

0 Answers  


What is c method?

0 Answers  


Categories