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
What is qq (double q)operator in perl?
What is the difference between single (') and double (") quote in a string in perl?
In Perl, there are some arguments that are used frequently. What are that arguments and what do they mean?
You want to empty an array. How would you do that?
What happens to objects lost in "unreachable" memory, such as the object returned by Ob->new() in `{ my $ap; $ap = [ Ob->new(), $ap ]; }' ?
What value is returned by a lone `return;’ statement?
How do you set environment variables in perl?
What is perl? What is the basic command to print a string in perl?
Explain what is perl language?
How many types of operators are used in the Perl?
Explain strftime() function in perl?
What is use of ‘->’ symbol?
Define perl scripting?
What do you mean by context of a subroutine?
Is perl a case sensitive language?