Learn PERL Basic with Me : Miles to Km converter PERL Script
|
Yesterday, I shared the first PERL script I have ever written. So for example, if you enter the name RAM That script will print Hi RAM, How are you today. Today's PERL script is a miles to km converter. So when you enter a value in miles it will convert it into Km.
Line 5 will ask for the value in miles
Line 5 whatever value you enter will be store as $mile
Line 11 Since 1 mile = 1.609344 kilometers therefore the value you entered (that is stored in $mile) will be multiplied (*) by 1.609344 and stored as $km
Line 13 Value of $km will be print
2. Can you wright a PERL script to convert days into hours
Miles to km converter
#!/usr/local/bin/perl # Km to miles converter print "Please Enter the value in mile: "; $mile =; # 1 mile = 1.609344 kilometers $km = $mile * 1.609344; print "Result: $km Kms \n";
break the code
PERL EXCERCISE 1
1. Can you wright a PERL script to convert hours into minutes2. Can you wright a PERL script to convert days into hours
Related Posts Learn PERL
|
Was This Post Useful? Add This To Del.icio.us Share on Facebook StumbleUpon This Add to Technorati Share on Twitter |
Labels:
Learn PERL
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment
Have Problem ?? Drop a comments here!