print "Would You like to Add Two numbers? y/n \n"; chomp($add = <STDIN>); if ($add = "y") { print "OK, press enter to continue \n"; chomp($nothing = <STDIN>); print "Enter Your First Number \n"; chomp($first = <STDIN>); print "Enter Your Second Number \n"; chomp($second = <STDIN>); $result = $first + $second; print "$first + $second = $result.\n"; chomp($end = <STDIN>) } else { print "Would You Like to Multiply Two Numbers? y/n \n"; chomp($mult = <STDIN>); if ($mult = "y") { print "Enter Your First Number \n"; chomp($firstm = <STDIN>); print "Enter Your Second Number \n"; chomp($secondm = <STDIN>); $result = $firstm * $secondm; print "$firstm * $secondm = $result.\n"; chomp($end2 = <STDIN>) } else { print "cool"; } chomp($jjf = <STDIN>); }
janitored by ybiC: Retitle from less-than-descriptive "What's The problem?" for better site search results
In reply to Debug basic calculator syntax by ROB6789
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |