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

What is the difference between perl array and perl hash?

978


In Perl, what is grep function used for?

1012


What does redo statement do in perl?

974


How to close a directory in perl?

872


How does a “grep” function perform?

966


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

935


What does the q{ } operator do?

848


How do you match one letter in the current locale?

956


How do you give functions private variables that retain their values between calls?

897


Explain grooving and shortening of arrays?

1030


Explain chomp, chop, cpan, tk.

880


How to sort arrays in perl?

969


What is a chop() function in perl?

953


What are the advantages of programming in perl?

954


What does `new $cur->{LINK}' do? (Assume the current package has no new() function of its own.)

891