Follow Slashdot blog updates by subscribing to our blog RSS feed

 



Forgot your password?
typodupeerror
User Journal

Journal DarkKnightRadick's Journal: My Tribute to Douglas Adams 1

#!/usr/bin/perl -w
#I have a feeling the answer will be 42

print "I have a feeling the answer will be the answer to Life! The Universe! And Everything!\n";
print "Please input the first number:";
chomp($first_num = <stdin>);
print "Please input the second number:";
chomp($second_num = <stdin>);
$answer = $first_num * $second_num;

if ($answer != 42) {
print "$first_num times $second_num is not the answer to Life! The Universe! And Everything! It's actually just $answer\n";
} else {
print "You know the answer to Life! The Universe! And Everything!\n";
}
This discussion has been archived. No new comments can be posted.

My Tribute to Douglas Adams

Comments Filter:

You do not have mail.

Working...