#include<stdio.h>

int main()
{
int a=3,post,pre;
post= a++ * a++ * a++;
a=3;
pre= ++a * ++a * ++a;
printf("post=%d pre=%d",post,pre);
return 0;
}

Answers were Sorted based on User's Feedback



#include<stdio.h> int main() { int a=3,post,pre; post= a++ * a++ * a++; a=3; pre= ++a ..

Answer / linku

post=27 pre=216

Is This Answer Correct ?    11 Yes 4 No

#include<stdio.h> int main() { int a=3,post,pre; post= a++ * a++ * a++; a=3; pre= ++a ..

Answer / manish

post= a++ * a++ * a++;
a++ is post increment so 3*3*3=27 and then a is incremented

pre= ++a * ++a * ++a;

++a pre increment
consider ++a * ++a
a incremented two times first result is 5 => 5*5=25
now we have 25 * ++a (a is 5)
a is again incremented (a become 6)
25 * 6 =150 ans

Is This Answer Correct ?    7 Yes 1 No

#include<stdio.h> int main() { int a=3,post,pre; post= a++ * a++ * a++; a=3; pre= ++a ..

Answer / manish

post=27 pre=150

Is This Answer Correct ?    6 Yes 2 No

Post New Answer

More C Code Interview Questions

could you please send the program code for multiplying sparse matrix in c????

0 Answers  


respected sir, i did my MCA in 2013 when i am going to attend to an interview i was asked about my project how will i explain my project could please help me in this and my project title is "Social Networking Site For Social Responsibility"

1 Answers   Genpact, Ozdocs,


main() { unsigned char i=0; for(;i>=0;i++) ; printf("%d\n",i); }

1 Answers  


Given an array of size N in which every number is between 1 and N, determine if there are any duplicates in it. You are allowed to destroy the array if you like.

21 Answers   ABC, eBay, Goldman Sachs, Google, HUP, Microsoft, TATA,


main() { static char names[5][20]={"pascal","ada","cobol","fortran","perl"}; int i; char *t; t=names[3]; names[3]=names[4]; names[4]=t; for (i=0;i<=4;i++) printf("%s",names[i]); }

2 Answers  






main() { char *p="GOOD"; char a[ ]="GOOD"; printf("\n sizeof(p) = %d, sizeof(*p) = %d, strlen(p) = %d", sizeof(p), sizeof(*p), strlen(p)); printf("\n sizeof(a) = %d, strlen(a) = %d", sizeof(a), strlen(a)); }

1 Answers  


main() { signed int bit=512, i=5; for(;i;i--) { printf("%d\n", bit >> (i - (i -1))); } } a. 512, 256, 0, 0, 0 b. 256, 256, 0, 0, 0 c. 512, 512, 512, 512, 512 d. 256, 256, 256, 256, 256

2 Answers   HCL,


main() { int i; clrscr(); printf("%d", &i)+1; scanf("%d", i)-1; } a. Runtime error. b. Runtime error. Access violation. c. Compile error. Illegal syntax d. None of the above

1 Answers   HCL,


main() { int i = 0xff ; printf("\n%d", i<<2); } a. 4 b. 512 c. 1020 d. 1024

2 Answers   HCL,


write a program to Insert in a sorted list

4 Answers   Microsoft,


Derive expression for converting RGB color parameters to HSV values

1 Answers  


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  


Categories