Search
 
SCRIPT & CODE EXAMPLE
 

SHELL

leap year bash shell

#!/bin/bash
echo "Program to check for leap year or not"
read -p "Enter the year: " year
if [ $((year%400)) -eq 0 ]
then
        echo "$year is a leap year"
elif [ $((year%100)) -eq 0 ]
then
        echo "$year is not a leap year"
elif [ $((year%4)) -eq 0 ]
then
        echo "$year is a leap year"
else
        echo "$year is not a leap year"
fi
Comment

PREVIOUS NEXT
Code Example
Shell :: git commit 
Shell :: bash read file line by line 
Shell :: how to get ips of any website 
Shell :: emacs copy paste 
Shell :: bash how to remove the first n lines of a file 
Shell :: install devtools 
Shell :: error permission to .git denied to deploy key 
Shell :: remove eclipse from ubuntu 
Shell :: server 2012r2 powershell unable to download from URI 
Shell :: reload crontab linux 
Shell :: linux path environment variable 
Shell :: run flask app from command line 
Shell :: public key generate 
Shell :: xcode open from terminal 
Shell :: check python running process linux 
Shell :: youtube-dl uninstall mac 
Shell :: how to setup dockers on aws 
Shell :: How can I reset or revert a file to a specific revision? 
Shell :: delete git branch remote 
Shell :: How to find your ip on debian linux wsl 
Shell :: how to check if your linux Server Is Under DDoS Attack 
Shell :: remove git remote 
Shell :: install rhythmbox 
Shell :: phpall version extension installation command on centos 7 
Shell :: find how many lines in a file linux 
Shell :: r installation on ubuntu 
Shell :: ingnore large files in github 
Shell :: display group of username mac 
Shell :: kubernetes get deployments 
Shell :: shell case example 
ADD CONTENT
Topic
Content
Source link
Name
1+7 =