Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $operation = $argv[1];
- $numberOne = intval(fgets(STDIN));
- $numberTwo = intval(fgets(STDIN));
- if ($operation == "sum") {
- echo " == " . ($numberOne + $numberTwo);
- }
- else if ($operation == "subtract") {
- echo " == " . ($numberOne - $numberTwo);
- }
- else{
- echo " == Wrong operation supplied" ;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement