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
Where do we require ‘chomp’ and what does it mean?
Explain use of ‘my’ keyword in perl?
Explain the internal working of cgi
What is q (single q) operator in perl?
what are prefix dereferencer and list them out?
List the files in current directory sorted by size ?
How can memory be managed in Perl?
How to do comment in perl?
What is eval function in perl?
“The methods defined in the parent class will always override the methods defined in the base class”. What does this statement means?
How do I sort a hash by the hash key?
Mention the difference between die and exit in Perl?
Is perl compiler or interpreter?
Which functions in perl allows you to include a module file. State their differences.
If you want to empty an array then how would you do that?