in reply to Find the biggest number from three numbers
The last print statement is only reached when C is not the biggest number and they are not all equal. If you put the last print outside of the else clause it will get executed more often
PS: Check out what gets printed if A and B are some random but different numbers and C==0
PPS: You should always have a line 'use warnings;' in your code (right after '#!/usr/bin/perl'). It helps you with finding bugs (not this one though).
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Find the biggest number from three numbers
by shrsv (Novice) on Dec 22, 2010 at 15:18 UTC | |
by shrsv (Novice) on Dec 22, 2010 at 15:21 UTC |