CS 220
40 points, due Sept. 26, 1997
x op ywhere x and y are non-negative integers and op is one of the four arithmetic operations. op is surrounded by a single space character on each side.
Write a procedure to read a non-negative integer, character by character and use that procedure in your program. Here is the algorithm for reading a number, in case you've forgotten it:
value = 0; c = getchar(); while ('0' <= c && c <= '9') { value = 10 * value + c - '0'; c = getchar(); }
Your program should validate its inputs before computing any results. Hand in a source SAL listing of your program and several sample runs (use script; see its man page).