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
What is goto statement in perl?
Explain the difference between declarations of 'my' and 'local' variable scope in perl?
What is the purpose of “_file_ literal” and “_line_ literal” in perl?
How to create a directory in perl?
What are the various uses of perl?
What is an interpolation in perl?
Explain ivalue?
How can the user execute a long command repeatedly without typing it again and again?
Why should I use the -w argument with my Perl programs?
What does undef function in perl?
what are the two ways to get private values inside a subroutine or block?
What are stdin, stdout and stderr?
What is the easiest way to download the contents of a URL with Perl?
What is cpan ? What are the modules coming under this?
Why to use perl?