diff options
| author | Sadeep Madurange <smadurange@users.noreply.github.com> | 2021-12-18 15:00:09 +0800 |
|---|---|---|
| committer | Sadeep Madurange <smadurange@users.noreply.github.com> | 2021-12-18 15:00:09 +0800 |
| commit | dae217441900d5e4960496f28804beb583fc1b1b (patch) | |
| tree | d179f8ac80f5fe2a6bfb6e1ee20ef834faa87ff0 /4 | |
| parent | a0114e7b05bca7100e6120b81aa26815eb1acd2d (diff) | |
| download | k&r-exercises-dae217441900d5e4960496f28804beb583fc1b1b.tar.gz | |
4.10
Diffstat (limited to '4')
| -rw-r--r-- | 4/10.c | 9 |
1 files changed, 9 insertions, 0 deletions
@@ -24,6 +24,15 @@ void clear(); int mgetline(); int getop(char[]); +/* Reverse Polish notation calculator + - single uppercase and lowercase characters are variables (syntax 2 A =); + - special variable LOUT for the last printed value. + - mathematical functions: sin, cos, tan, exp, pow. + - custom functions: swp (swap top 2 values), dup (duplicate last value), + top (peek at the stack top), cls (clear stack). + - operators: +, -, *, /, % and = + - press enter to print the value at the top of the stack. + */ int main(int argc, char *argv[]) { int type, op1, op2; char s[MAXOP]; |
