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
How will you open a file in read-only mode in perl?
What is the purpose of _package_ literal?
What are perl strings?
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.
What is the different between array and hash in perl programming?
Hi, I am a accountant. I am preparing a balance sheet but because of staff shortage and time pressures I cant complete it on time. There is lot of common data with last years which I need not retype and I can manage by editing last year’s balance sheet ? Is their any software on net where I can do this easily??
How do I pass a command line argument in perl?
Explain string comparison operators in perl.
How do you give functions private variables that retain their values between calls?
What are stdin, stdout and stderr?
How to read from a pipeline with Perl
How to determine strings length in perl?
What is perl scripting?
What are the logical operators used for small scale operations? Explain them briefly.
What is the difference between localtime() and gmtime() functions?