Shell program to read a number and find the sum of digits

in Categories Academic, Shell Math last updated April 8, 2008

Shell program to read a number and reverse the number

in Categories Academic, Shell Math last updated April 8, 2008

Shell program to read two numbers and display all the odd numbers berween those two number

in Categories Academic, Decision Making last updated April 8, 2008

Shell program to display numbers from 1 to 10

in Categories Academic last updated April 8, 2008

Shell Script to read any year and find whether it is a leap year or not

in Categories Time and Date last updated April 5, 2008

A leap year comes once every four years. It is the year when an extra day is added to the Gregorian calendar used by most of the world.

An ordinary year has 365 days. A leap year has 366 days. The extra day is added to the month of February. In an ordinary year, February has 28 days. In a leap year, it has 29 days. This extra day is called a leap day.

How do I find out leap year?

A year is a leap year if it can be evenly divided by four. For example, 1996 was a leap year. But a year is not a leap year if can be evenly divided by 100 and not by 400. This is why 1700, 1800, 1900 were not leap years, but 2000 was.

Shell script to determine if entered year is leap or not…

Shell Script to read the base and height of a traingle and find its area

in Categories Shell Math last updated April 3, 2008

Calculating the area of a triangle is an elementary problem encountered often in many different situations. The best known, and simplest formula is

Computing the area of a triangle

Where S is area, b is the length of the base of the triangle, and h is the height or altitude of the triangle. The term ‘base’ denotes any side, and ‘height’ denotes the length of a perpendicular from the point opposite the side onto the side itself.