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 ?    7 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Explain regular expression in perl?

1018


Assuming both a local($var) and a my($var) exist, what's the difference between ${var} and ${"var"}?

1039


Define perl scripting?

1031


Explain goto expr?

923


How do I debug a perl program?

1031


Differentiate between arrays and list in perl.

1033


What is the purpose of goto expr statement?

961


What does cgi program store?

958


How to read a directory in perl?

1104


How to read file into hash array ?

1174


What is the use of now constructor in perl?

1020


How to prevent file truncation in perl?

1083


How to start perl in interactive mode?

1116


What are some common methods to all handles in perl?

976


Explain tk?

1070