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
Differentiate between use and require, my and local, for and foreach and exec and system
Explain the default scope of variables in perl?
How can I display all array element in which each element will display on next line in perl ?
What is a chop() function in perl?
What does a die() function do in perl?
Mention how many ways you can express string in Perl?
What are the various uses of perl?
Explain split function in perl?
What is perl programming?
List all the features of perl programming?
What is use of ‘->’ symbol?
Who created perl?
How can you use Perl warnings and what is the importance to use them?
What does 'do' statement do in perl?
If EXPR is an arbitrary expression, what is the difference between $Foo::{EXPR} and *{"Foo::".EXPR}?