Untitled

mail@pastecode.io avatar
unknown
plain_text
2 years ago
629 B
9
Indexable
Never
<?php

$firstNumber = readline("please enter first number:");

$secondNumber = readline("please eneter the second number : ");

$operator = readline("please enter the operator : ");


if($operator == '+'){
    echo $firstNumber + $secondNumber . PHP_EOL;
}elseif($operator == '-'){
    echo $firstNumber - $secondNumber . PHP_EOL;
}elseif($operator == '*'){
    echo $firstNumber * $secondNumber . PHP_EOL;
}elseif($operator == '/'){
    echo $firstNumber / $secondNumber . PHP_EOL;
}elseif($operator == '%'){
    echo $firstNumber % $secondNumber . PHP_EOL;
}else{
    echo "undefind operator". PHP_EOL;
}