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 does the qx{ } operator do?
How interpreter is used in perl?
What are the two ways to get private values inside a subroutine?
Give an example of the -i and 0s option usage.
What is the difference between use and require in perl?
what is the function of Return Value?
Why aren't Perl's patterns regular expressions?
What are the reasons that cookie server can’t handle multiple connections?
How do I read command-line arguments with Perl?
What are the arguments and what do they mean in perl programming?
How do you give functions private variables that retain their values between calls?
How to read multi lines from a file in perl?
How we can navigate the xml documents?
Explain what is lvalue?
Is there any way to add two arrays together?