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).

  • Comment on Re: Find the biggest number from three numbers

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
    Will be using it in my next experiments. Thank you for the suggestion
      Hey i gotta think again what's causing for that all numbers are equal when entered 0 for C Checking it out. Thanks ;)