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

How can memory be managed in Perl?

1046


how to get back up from private character editor which is saved in the format of .udf

2282


What is the purpose of goto expr statement?

907


When do you use perl programming?

989


What is posix in perl?

931


Explain the difference between die and exit in perl?

866


Explain perl. When do you use perl for programming? What are the advantages of programming in perl?

874


What are the options that can be used to avoid logic errors in perl?

950


What does Perl do if you try to exploit the execve(2) race involving setuid scripts?

939


How do I print the entire contents of an array with Perl?

941


Explain join function in perl?

951


Why is it hard to call this function: sub y { "because" } ?

951


What does a die() function do in perl?

969


There is no strict data types in perl unlike in other high level languages like Java so wouldn't that be a problem if a code in perl is to be a written by a big team of 20+ members ?"

2390


How to prevent file truncation in perl?

1006