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 purpose of redo statement?
What is the use of 'ne' operator?
What rules must be followed by modules in perl.
What are the arguements we normally use for perl interpreter?
How to prevent file truncation in perl?
When do you use perl programming?
How to implement a stack in Perl?
What is the difference between die and exit in perl?
Explain lexical variables.
Explain grooving and shortening of arrays and splicing of arrays?
Is perl compiler or interpreter?
Is there any way to add two arrays together?
Hi, I am a accountant. I am preparing a balance sheet but because of staff shortage and time pressures I cant complete it on time. There is lot of common data with last years which I need not retype and I can manage by editing last year’s balance sheet ? Is their any software on net where I can do this easily??
How to start perl in interactive mode?
what is Polymorphism in Perl?