write a script to check whether user enter a value is a
leap year or not?
Answer Posted / sourisengupta
#call this function by passing the year....
sub isLeapyear
{
$year=shift;
if($year%4==0){
if($year%100==0){
if($year%400==0)
return 1;
return 0;
}
return 1;
}
}
Is This Answer Correct ? | 7 Yes | 2 No |
Post New Answer View All Answers
Explain about the applications of perl?
How do I sort a hash by the hash value?
What is the use of -n and -p options?
what is the function that is used to identify how many characters are there in a string?
What are perl variables?
List the data types that Perl can handle?
What is the importance of perl warnings? How do you turn them on?
What is the syntax used in Perl grep function?
What are the benefits of perl in using it as a web-based application?
We all know private variables exist in perl. But do private METHODS exist in perl ? Eg ?
What can be done for efficient parameter passing in perl? Explain.
What is the easiest way to download the contents of a URL with Perl?
How to turn on Perl warnings? Why is that important?
What $! In perl?
What are the arguments and what do they mean in perl programming?