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
How to remove a directory in perl?
You want to concatenate strings with perl. How would you do that?
What's the difference between /^Foo/s and /^Foo/?
What is Perl?
How to merge two arrays in perl?
What are the arguments and what do they mean in perl programming?
In CPAN module, name an instance you use.
what is Chop & Chomp function does?
How do you you check the return code of a command in perl?
How to get help for perl?
What are the features of perl language?
You want to open and read data files with perl. How would you do that?
For a situation in programming, how can you determine that Perl is a suitable?
Create a function that is only available inside the scope where it is defined ?
How to close a file in perl?