Ask your own question, for FREE!
MIT 6.00 Intro Computer Science (OCW) 11 Online
OpenStudy (anonymous):

With the help of stack or any other way solve the following expression.With detailed explanation. int x=5; x=x++ + ++x + --x + ++x + x++ + --x + x++; printf(x);

OpenStudy (anonymous):

> x=46; :) Analise this code: #include <stdio.h> #include <stdlib.h> int main (void){ int x=5, exp1 = (x++), // add 1 to "next x" exp2 = (++x), // add 1 to this(now) exp3 = (--x), // decrement 1 to this(now) exp4 = (++x), // add 1 to this(now) exp5 = (x++), // add 1 to "next x" exp6 = (--x), // decrement 1 to this(now) exp7 = (x++); // add 1 to "next x" printf("x=x++ + ++x + --x + ++x + x++ + --x + x++;\n"); printf("x=%3d + %3d + %3d + %3d + %3d + %3d + %3d;\n",exp1,exp2,exp3,exp4,exp5,exp6,exp7); printf("x=%d\n",exp1+exp2+exp3+exp4+exp5+exp6+exp7); }

Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!
Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!