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
Explain regular expression in perl?
Assuming both a local($var) and a my($var) exist, what's the difference between ${var} and ${"var"}?
Define perl scripting?
Explain goto expr?
How do I debug a perl program?
Differentiate between arrays and list in perl.
What is the purpose of goto expr statement?
What does cgi program store?
How to read a directory in perl?
How to read file into hash array ?
What is the use of now constructor in perl?
How to prevent file truncation in perl?
How to start perl in interactive mode?
What are some common methods to all handles in perl?
Explain tk?