#!/usr/bin/perl -w use strict; use warnings; print "Enter a number\n"; my $number = <>; chomp($number); my $sendthis = ''; # this area is working if ($number) { if ($number >= 10 ) { $sendthis = $number - 2; print "You sent: $sendthis\n"; } # this area not working if ($number >= 20 ) { $sendthis = $number - 3; print "You sent: $sendthis\n"; # WHEN I ENTER IN 23 # THE OUTPUT IS # You sent: 21 ---- I DONT NEED THIS # You sent: 20 ---- THIS IS THE RIGHT ANSWER } # and this not working if ($number >= 50 ) { $sendthis = $number - 4; print "You sent: $sendthis\n"; # WHEN I ENTER IN 55 # THE OUTPUT IS # You sent: 53 ---- I DONT NEED THIS # You sent: 52 ---- I DONT NEED THIS # You sent: 51 ---- THIS IS THE RIGHT ANSWER } }