Hey there! i have to make a program of mine loop.
Do you have any ideas on the condition in the loop i can put?
by the way i have to make this program loop.
#! /usr/bin/perl -w print "Type in a number: "; $x = <>; print "Type in another number: "; $y = <>; print "What would you like done?\n\nYour choice is:\n1) Add\n2) Subtra +ct\n3) Multiply\n4) Divide\n"; $ask = <>; chomp ($ask); if ($ask eq "Add") { print $x + $y,"\n";} if ($ask eq "Subtract") { print $x - $y,"\n";} if ($ask eq "Divide") { print $x / $y, "\n";} if ($ask eq "Multiply") { print $x * $y, "\n";}
In reply to any loop ideas? by rse2
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |