#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

program to find magic aquare using array

4 Answers   HCL,


main ( ) { static char *s[ ] = {“black”, “white”, “yellow”, “violet”}; char **ptr[ ] = {s+3, s+2, s+1, s}, ***p; p = ptr; **++p; printf(“%s”,*--*++p + 3); }

1 Answers  


#define square(x) x*x main() { int i; i = 64/square(4); printf("%d",i); }

4 Answers   Google, HCL, Quick Heal, WTF,


main() { int *j; { int i=10; j=&i; } printf("%d",*j); }

9 Answers   HCL, Wipro,


plz send me all data structure related programs

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  


Link list in reverse order.

8 Answers   NetApp,


source code for delete data in array for c

1 Answers   TCS,


write a function to give demostrate the functionality of 3d in 1d. function prototye: change(int value,int indexX,int indexY,int indexZ, int [] 1dArray); value=what is the date; indexX=x-asix indexY=y-axis indexZ=z-axis and 1dArray=in which and where the value is stored??

0 Answers   Nagarro,


Is there any difference between the two declarations, 1. int foo(int *arr[]) and 2. int foo(int *arr[2])

1 Answers  


Write a prog to accept a given string in any order and flash error if any of the character is different. For example : If abc is the input then abc, bca, cba, cab bac are acceptable, but aac or bcd are unacceptable.

5 Answers   Amazon, Microsoft,


#define max 5 #define int arr1[max] main() { typedef char arr2[max]; arr1 list={0,1,2,3,4}; arr2 name="name"; printf("%d %s",list[0],name); }

1 Answers  


Categories