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


Please Help Members By Posting Answers For Below Questions

Explain about the applications of perl?

544


How do I sort a hash by the hash value?

555


What is the use of -n and -p options?

600


what is the function that is used to identify how many characters are there in a string?

535


What are perl variables?

524






List the data types that Perl can handle?

573


What is the importance of perl warnings? How do you turn them on?

544


What is the syntax used in Perl grep function?

587


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

493


We all know private variables exist in perl. But do private METHODS exist in perl ? Eg ?

2001


What can be done for efficient parameter passing in perl? Explain.

556


What is the easiest way to download the contents of a URL with Perl?

558


How to turn on Perl warnings? Why is that important?

576


What $! In perl?

527


What are the arguments and what do they mean in perl programming?

519