BASH SCRIPTING EXAMPLES:
- We have already saw some basic syntax and method to implement those syntax.
- Today lets see some basic program that uses the basic logic to solve some problems.
- Some problems are:
- Finding whether the given year is leap year or not.
- This program will accept a year as a input.
- Check whether it solve a given condition : (( year%4==0 && year%100!=0 )|| year%400==0)
- Finding whether the given number is prime or not.
- A number is prime if it is divisible by only one and itself .
- If the number is divisible by other than the two number then the given number is not prime.
- Creating a guessing game .
- This will generate a random number for every run.
- We are given three attempt to guess the number.
Note :
The above programs are uploaded in github.
It is possible to download these code from github.
I'll provide the link to github below.
No comments:
Post a Comment