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
Explain grooving and shortening of arrays and splicing of arrays?
Can you add two arrays together?
Write syntax to use grep function?
What syntax is used for grep() function?
What is it meants by '$_'?
What's the difference between /^Foo/s and /^Foo/?
Explain about the applications of perl?
How would you ensure the re-use and maximum readability of your perl code?
Explain tk?
Why to use perl?
Explain chomp?
Explain the default scope of variables in perl?
Explain goto name?
What are some of the key features of objects in perl?
What is the use of -w, -t and strict in Perl?