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 qq{ } operator do?
Explain ivalue?
You want to connect to sql server through perl. How would you do that?
What is grep used for in perl?
Which functions in Perl allows you to include a module file or a module and what is the difference between them?
What are the arguments and what do they mean in perl programming?
There are some duplicate entries in an array and you want to remove them. How would you do that?
What is “grep” function in perl?
We all know private variables exist in perl. But do private METHODS exist in perl ? Eg ?
Explain socket programming in perl?
What does 'do' statement do in perl?
Explain subroutine?
Which functions in perl allows you to include a module file.
What does the q{ } operator do?
Which functions in perl allows you to include a module file. State their differences.