Here's the question you clicked on:

55 members online
  • 0 replying
  • 0 viewing

rakesh.sirwani

  • 2 years ago

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);

  • This Question is Open
  1. sofiasores
    • 2 years ago
    Best Response
    You've already chosen the best response.
    Medals 1

    > 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); }

  2. Not the answer you are looking for?
    Search for more explanations.

    • Attachments:

Ask your own question

Sign Up
Find more explanations on OpenStudy
Privacy Policy