#!usr/bin/perl-w
$a=0.9; $b=0.7; $c=0.5;
if($a>$b>$c){print"\n$a is largest.\n";$x1=$b/$a;$x2=$c/$a;# Line 3
$x1r=sprintf("%.2f",$x1);$x2r=sprintf("%.2f",$x2);
print"\n values are $x1r, $x2r";
} elsif($b>$c>$a){print"\n$b is largest.\n";$x3=$c/$b;$x2=$a/$b;# Line 6
$x3r=sprintf("%.2f",$x3);$x4r=sprintf("%.2f",$x4);
print"\n values are $x3r, $x4r";
} else($c>$a>$b){print"\n$c is largest.\n";$x5=$c/$b;$x6=$a/$b;# Line 9
$x5r=sprintf("%.2f",$x5);$x6r=sprintf("%.2f",$x6);
print"\n values are $x5r, $x6r";
}
exit;# Line 13
####
Microsoft Windows [Version 6.1.7600]
Copyright (c) 2009 Microsoft Corporation. All rights reserved.
C:\Users\DR-SUPRIYO>cd desktop
C:\Users\DR-SUPRIYO\Desktop>test.pl
syntax error at C:\Users\DR-SUPRIYO\Desktop\test.pl line 3, near "$b>"
syntax error at C:\Users\DR-SUPRIYO\Desktop\test.pl line 6, near "}"
syntax error at C:\Users\DR-SUPRIYO\Desktop\test.pl line 9, near "}"
syntax error at C:\Users\DR-SUPRIYO\Desktop\test.pl line 12, near "}"
Execution of C:\Users\DR-SUPRIYO\Desktop\test.pl aborted due to compilation erro
rs.
##
##
My Expected Result should look like this:
0.9 is largest.
values are 0.78, 0.56