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

What is qq (double q)operator in perl?

749


What is the difference between single (') and double (") quote in a string in perl?

635


In Perl, there are some arguments that are used frequently. What are that arguments and what do they mean?

669


You want to empty an array. How would you do that?

628


What happens to objects lost in "unreachable" memory, such as the object returned by Ob->new() in `{ my $ap; $ap = [ Ob->new(), $ap ]; }' ?

721






What value is returned by a lone `return;’ statement?

742


How do you set environment variables in perl?

716


What is perl? What is the basic command to print a string in perl?

652


Explain what is perl language?

663


How many types of operators are used in the Perl?

753


Explain strftime() function in perl?

679


What is use of ‘->’ symbol?

726


Define perl scripting?

745


What do you mean by context of a subroutine?

725


Is perl a case sensitive language?

833