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

Where do we require ‘chomp’ and what does it mean?

512


Explain use of ‘my’ keyword in perl?

567


Explain the internal working of cgi

505


What is q (single q) operator in perl?

529


what are prefix dereferencer and list them out?

633






List the files in current directory sorted by size ?

518


How can memory be managed in Perl?

537


How to do comment in perl?

577


What is eval function in perl?

543


“The methods defined in the parent class will always override the methods defined in the base class”. What does this statement means?

528


How do I sort a hash by the hash key?

565


Mention the difference between die and exit in Perl?

654


Is perl compiler or interpreter?

535


Which functions in perl allows you to include a module file. State their differences.

524


If you want to empty an array then how would you do that?

569