
Write a program that reads two integers and an operator from the command line, then prints the computed result.
./calc 7 + 5 | cat -eExpected result
12$For your own tracking. Tests grade your code.
./calc 100 / 4 | cat -eExpected result
25$./calc 17 % 5 | cat -eExpected result
2$./calc | cat -eExpected result
wrong number of arguments$Expected files
calc.cAllowed functions
atoiprintfwrite
v0.40: Create exercises. Challenge the community.
Meet Studio →Write a program that reads two integers and an operator from the command line, then prints the computed result.
./calc 7 + 5 | cat -eExpected result
12$For your own tracking. Tests grade your code.
./calc 100 / 4 | cat -eExpected result
25$./calc 17 % 5 | cat -eExpected result
2$./calc | cat -eExpected result
wrong number of arguments$Expected files
calc.cAllowed functions
atoiprintfwrite
Run the tests to grade your code
Build your code, then check each test here. Open a result to inspect its output.