Search
 
SCRIPT & CODE EXAMPLE
 

PHP

Check if a year is leap year

#include<iostream>
using namespace std;
int main() {
   int year = 2016;
   if (((year % 4 == 0) && (year % 100 != 0)) || (year % 400 == 0))
   cout<<year<<" is a leap year";
   else
   cout<<year<<" is not a leap year";
   return 0;
}
Comment

how can you know if a year is a leap year

leapYear = int(input("Input a Year "))

if leapYear %4 == 0:
    print("Its a leap year")
else:
    print ("Its a normal year")
Comment

Code to check Check whether a year is leap year or not

<?php
    $year = 2022;
    if($year % 4 == 0) {
      echo $year." is a leap year";
    }
    else {
      echo $year." is a not leap year";
    }
  ?>
Comment

check leap year

def is_leap_year(year):
        """This functon returns True if year is a leap year, returns False otherwise"""
        if year % 4 == 0:
                return True
        return False
Comment

PREVIOUS NEXT
Code Example
Php :: laravel create command tutorial 
Php :: if one condition 
Php :: :: in php 
Php :: laravel redirect problem 
Php :: laravel upload image 
Php :: php ascii to decimal 
Php :: twig url 
Php :: laravel run function after forgot password 
Php :: laravel available router methods 
Php :: router php 
Php :: join multiple query in laravel 
Php :: php-oop 
Php :: how to fetch data from database in php 
Php :: laravel imap - Set message flags 
Php :: Custom search form 
Php :: yii2 change transport 
Php :: how to add php to html 
Php :: PHP Dependency Resolver 
Php :: laravel create multiple request 
Php :: codeigniter admin panel with crud generator - 
Php :: How to send JSON format data in postman to django models that have a foreign key to another model 
Php :: ob_start store variable in php 
Php :: Laravel FileManager Display Blank pop up page 
Php :: auto complete order paid3 
Php :: laravel same route different group 
Php :: an einem string etwas anfügen php 
Php :: one-through-many 
Php :: laravel query buider 
Php :: add object to http request php behamin proxy bproxy 
Php :: upsert request php-salesforce-rest-api 
ADD CONTENT
Topic
Content
Source link
Name
9+9 =