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


Please Help Members By Posting Answers For Below Questions

How would you ensure the re-use and maximum readability of your perl code?

518


How do you find the length of an array?

554


How to merge two arrays in perl?

518


Write a cgi program to show the header part?

523


Explain the use of 'my' keyword in perl?

559






When would `local $_' in a function ruin your day?

537


Explain grooving and shortening of arrays?

701


Explain the meaning of perl one-liner?

510


Explain subroutine in perl?

487


What is the importance of perl warnings?

535


What does undef function in perl?

521


How to sort arrays in perl?

618


What is the use of –w?

531


What is 'rollback' command in perl?

546


What are the benefits of perl in using it as a web-based application?

494