Computer Science, asked by Sapnapearl7574, 8 months ago

3. void test 3(char c)System.out.println( (int) c);if 'm' is passed to c.​

Answers

Answered by Anonymous
0

Answer:

#include

#define EOF -1

void push (int); /* push the argument on the stack */

int pop (void); /* pop the top of the stack */

void flagError ();

int main ()

{ int c, m, n, r;

while ((c = getchar ()) != EOF)

{ if (isdigit (c) )

push (c);

else if ((c == '+') || (c == '*'))

{ m = pop ();

n = pop ();

r = (c == '+') ? n + m : n*m;

push (r);

}

else if (c != ' ')

flagError ();

}

printf("% c", pop ());

}

Similar questions