Write a Perl script that reads a number from the keyboard andprints the number f
ID: 3611040 • Letter: W
Question
Write a Perl script that reads a number from the keyboard andprints the number followed by "is positive", "is negative" , or "iszero" depending on the value read in. The script should keepreading values until Ctrl + d is pressed at the keyboard. Write thescript and test it. Write a Perl script that reads a number from the keyboard andprints the number followed by "is positive", "is negative" , or "iszero" depending on the value read in. The script should keepreading values until Ctrl + d is pressed at the keyboard. Write thescript and test it.Explanation / Answer
Dear, #!/usr/bin/perl -w print"Please enter number "; chomp($num =<STDIN>); if ($num< 0) { print "an negitivenumber."; } elsif ($num ==0) { print"zero."; } else { print "an positivenumber."; } I hope this ishelpful for you......
Related Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.