From d9d53cbdaea6f3e87af19587504be04f66467f8f Mon Sep 17 00:00:00 2001 From: Sadeep Madurange Date: Sat, 18 Dec 2021 15:16:31 +0800 Subject: 4.10 --- 4/10.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/4/10.c b/4/10.c index 83a9053..c89bf0b 100644 --- a/4/10.c +++ b/4/10.c @@ -50,8 +50,8 @@ int main(int argc, char *argv[]) { push(op1 + op2); break; case '-': - op1 = pop(); op2 = pop(); + op1 = pop(); push(op1 - op2); break; case '*': @@ -147,7 +147,7 @@ int getop(char s[]) { // special characters and operators if (c == 0 || c == '+' || c == '*' || c == '/' || c == '%' || c == '\n' || - (c == '-' && !isdigit(line[idx + 1])) || c == EOF) + (c == '-' && !isdigit(line[idx])) || c == EOF) return c; i = 0; -- cgit v1.2.3