Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

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


Please Help Members By Posting Answers For Below Questions

What is goto statement in perl?

938


Explain the difference between declarations of 'my' and 'local' variable scope in perl?

919


What is the purpose of “_file_ literal” and “_line_ literal” in perl?

916


How to create a directory in perl?

1075


What are the various uses of perl?

1022


What is an interpolation in perl?

992


Explain ivalue?

1002


How can the user execute a long command repeatedly without typing it again and again?

931


Why should I use the -w argument with my Perl programs?

960


What does undef function in perl?

944


what are the two ways to get private values inside a subroutine or block?

939


What are stdin, stdout and stderr?

1112


What is the easiest way to download the contents of a URL with Perl?

954


What is cpan ? What are the modules coming under this?

923


Why to use perl?

952