Write a shell script to find the maximum of three numbers, Programming Languages

 W.A.S.S to find the maximum of three numbers

Program

# W.A.S.S to find the maximum of three numbers


echo "Enter three No.:"
read no1
read no2
read no3

if test $no1 -gt $no2                    # -gt is stands for greater than
then
if test $no1 -gt $no3                    # Return a status of 0 (True) or 1 (False) depending on the
                                                  # evaluation  of the conditional expression exp
then
echo "$no1 is  Max of three nos."
else
echo "$no3 is Max of three nos."
fi                           # fi is the end of if..else block
else
if test $no2 -gt $no3
then
echo "$no2 is Max of three nos."
else
echo "$no3 is Max of three nos."
fi
fi

Output

Enter three No.:
10
15
12
15 is Max of three nos.

Posted Date: 9/26/2012 4:23:40 AM | Location : United States







Related Discussions:- Write a shell script to find the maximum of three numbers, Assignment Help, Ask Question on Write a shell script to find the maximum of three numbers, Get Answer, Expert's Help, Write a shell script to find the maximum of three numbers Discussions

Write discussion on Write a shell script to find the maximum of three numbers
Your posts are moderated
Related Questions
how to concatinate two strings in assembly

Detailed Description: • The program will take temperature readings as input from user for specified number of consecutive days. • Program will store these temperature values into

Write a program that will allow the user to input the corners of a triangle. The program will draw small yellow circles for each input point, then draw the triangle and calculate t

Question 1- In engineering applications it is often necessary to fit a straight line to a set of N points with known coordinates (xi, yi), where i indexes the points (N in total).

( Airline Reservations System ) A small airline has just purchased a computer for its new automated reservations system. You have been asked to develop the new system. You are to w

This assignment will make use of arrays and functions to simulate a game. ASSIGNMENT DESCRIPTION This program will simulate part of the game of Yahtzee! The player will

Hi I have an assignment for prolog languagle is it possible to get help

Write a script called 'prob2.m' that asks the user if they wish to clear the variables in the workspace. If the user responds with the strings 'y' or 'yes' then the workspace shoul

On a single XHTML page, include the following two div container elements in the body. Using an external stylesheet, add style to the div elements such that one div has some overlap

Write a python script that will take two file names as input (src, dest). Open src reading each line in the file, and replacing any occurrences of name with the string "redacted".