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 the difference between perl array and perl hash?
In Perl, what is grep function used for?
What does redo statement do in perl?
How to close a directory in perl?
How does a “grep” function perform?
If EXPR is an arbitrary expression, what is the difference between $Foo::{EXPR} and *{"Foo::".EXPR}?
What does the q{ } operator do?
How do you match one letter in the current locale?
How do you give functions private variables that retain their values between calls?
Explain grooving and shortening of arrays?
Explain chomp, chop, cpan, tk.
How to sort arrays in perl?
What is a chop() function in perl?
What are the advantages of programming in perl?
What does `new $cur->{LINK}' do? (Assume the current package has no new() function of its own.)