#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

main() { char *a = "Hello "; char *b = "World"; clrscr(); printf("%s", strcpy(a,b)); } a. “Hello” b. “Hello World” c. “HelloWorld” d. None of the above

4 Answers   Corporate Society, HCL,


Program to Delete an element from a doubly linked list.

4 Answers   College School Exams Tests, Infosys,


Write a C program to add two numbers before the main function is called.

11 Answers   Infotech, TC,


All the combinations of prime numbers whose sum gives 32

1 Answers   HHH,


How can i find first 5 natural Numbers without using any loop in c language????????

2 Answers   Microsoft,






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

0 Answers  


Write a C program to print look and say sequence? For example if u get the input as 1 then the sequence is 11 21 1211 111221 312211 12112221 .......(it counts the no. of 1s,2s etc which is in successive order) and this sequence is used in run-length encoding.

1 Answers  


#include<stdio.h> void fun(int); int main() { int a; a=3; fun(a); printf("\n"); return 0; } void fun(int i) { if(n>0) { fun(--n); printf("%d",n); fun(--n); } } the answer is 0 1 2 0..someone explain how the code is executed..?

1 Answers   Wipro,


How will u find whether a linked list has a loop or not?

8 Answers   Microsoft,


void main() { static int i=i++, j=j++, k=k++; printf(“i = %d j = %d k = %d”, i, j, k); }

3 Answers  


#define assert(cond) if(!(cond)) \ (fprintf(stderr, "assertion failed: %s, file %s, line %d \n",#cond,\ __FILE__,__LINE__), abort()) void main() { int i = 10; if(i==0) assert(i < 100); else printf("This statement becomes else for if in assert macro"); }

1 Answers  


how to swap 3 nos without using temporary variable

4 Answers   Satyam,


Categories