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

Answer is 12

Is This Answer Correct ?    4 Yes 1 No

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

Answer / lucky varshney

answer is 11

Is This Answer Correct ?    1 Yes 2 No

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

Answer / susie

Answer :

Output Cannot be predicted exactly.

Explanation:

Side effects are involved in the evaluation of i

Is This Answer Correct ?    0 Yes 5 No

Post New Answer

More C Code Interview Questions

#include<stdio.h> main() { struct xx { int x=3; char name[]="hello"; }; struct xx *s=malloc(sizeof(struct xx)); printf("%d",s->x); printf("%s",s->name); }

1 Answers   TCS,


void pascal f(int i,int j,int k) { printf(“%d %d %d”,i, j, k); } void cdecl f(int i,int j,int k) { printf(“%d %d %d”,i, j, k); } main() { int i=10; f(i++,i++,i++); printf(" %d\n",i); i=10; f(i++,i++,i++); printf(" %d",i); }

1 Answers  


What is full form of PEPSI

0 Answers  


main() { int i =0;j=0; if(i && j++) printf("%d..%d",i++,j); printf("%d..%d,i,j); }

1 Answers  


main() { int *ptr=(int*)malloc(sizeof(int)); *ptr=4; printf("%d",(*ptr)+++*ptr++); }

3 Answers   GNITC,






How will you print % character? a. printf(“\%”) b. printf(“\\%”) c. printf(“%%”) d. printf(“\%%”)

4 Answers   HCL,


main(){ unsigned int i; for(i=1;i>-2;i--) printf("c aptitude"); }

2 Answers  


main() { char *p; p="%d\n"; p++; p++; printf(p-2,300); }

1 Answers  


main() { printf("%d, %d", sizeof('c'), sizeof(100)); } a. 2, 2 b. 2, 100 c. 4, 100 d. 4, 4

18 Answers   HCL, IBM, Infosys, LG Soft, Satyam,


char *someFun() { char *temp = “string constant"; return temp; } int main() { puts(someFun()); }

1 Answers  


Write a procedure to implement highlight as a blinking operation

2 Answers  


void main() { int i; char a[]="\0"; if(printf("%s\n",a)) printf("Ok here \n"); else printf("Forget it\n"); }

3 Answers   Accenture,


Categories