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
Can you add two arrays together?
Differentiate between use and require, my and local, for and foreach and exec and system
Why -w argument is used with perl programs?
what are steps to do to lock the sony ericsson mobile with password?
What is perl push array function?
What does length(%HASH) produce if you have thirty-seven random keys in a newly created hash?
How do you match one letter in the current locale?
Explain chomp?
Does Perl have reference type?
What does 'do' statement do in perl?
What is the purpose of goto expr statement?
Where do we require ‘chomp’ and what does it mean?
What is confess function in perl?
how to create a flat file database as shown below s.no name age city phone 0 hema 22 Calcutta 4312542 1 hema 21 Bangalore 2344345 2 ganesh 25 delhi 2445454 3 kartik 45 pune 4312121 4 santosh 25 Hyderabad 2254231 5 kumar 25 mysore 2344567 6 gita 34 mangalore 6532123 7 gita 32 pune 2213456 Q1.print the details of the person who r from bangalore q2.Replace the city name managlore to pune q3.prints no of person having name gita and hema q4.print how many are of age 25.
How do you set environment variables in perl?