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 ? | 14 Yes | 2 No |
Post New Answer View All Answers
How would you ensure the re-use and maximum readability of your perl code?
How do you find the length of an array?
How to merge two arrays in perl?
Write a cgi program to show the header part?
Explain the use of 'my' keyword in perl?
When would `local $_' in a function ruin your day?
Explain grooving and shortening of arrays?
Explain the meaning of perl one-liner?
Explain subroutine in perl?
What is the importance of perl warnings?
What does undef function in perl?
How to sort arrays in perl?
What is the use of –w?
What is 'rollback' command in perl?
What are the benefits of perl in using it as a web-based application?