programming-examples/perl/Datatype/Miles-to-kilometers converter.pl

10 lines
333 B
Perl
Raw Normal View History

2019-11-15 12:59:38 +01:00
#!/usr/local/bin/perl
print ("Enter the distance to be converted:\n");
$originaldist = <STDIN>;
chop ($originaldist);
$miles = $originaldist * 0.6214;
$kilometers = $originaldist * 1.609;
print ($originaldist, " kilometers = ", $miles," miles\n");
print ($originaldist, " miles = ", $kilometers, " kilometers\n");