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


Please Help Members By Posting Answers For Below Questions

Write a program to show the process of spawning a child process

447


Explain the different types of data perl can handle.

489


Explain lists ?

524


How do find the length of an array?

516


How will you access an element of a perl array?

512






What is the difference between exec and system?

552


Distinguish my and local?

515


If EXPR is an arbitrary expression, what is the difference between $Foo::{EXPR} and *{"Foo::".EXPR}?

504


What package you use to create a windows services?

489


How to find the length of an array in perl?

561


Explain chop?

534


What are the advantages of c over Perl?

522


Explain the meaning of perl one-liner?

506


what is CPAN?

543


What is goto statement in perl?

508