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
Normal 0 false false false EN-US X-NONE X-NONE MicrosoftInternetExplorer4

You are to Use ASCII operations to design an IA-32 assembly language program which will do addition and subtraction on positive integers of any length represented in characters. T

Problem 1 Define the architecture of UNIX operating system with appropriate diagram Problem 2 Define the term inter-process communication. What are several approaches t

the details on the two pictures on the link below : http://rak-up.com/up/files/18637.jpg ">http://rak-up.com/up/files/18636.jpg http://rak-up.com/up/files/18637.jpg

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

Consider the following LP problem: min x 1 +3 x2 +x 3 -x 4 s.t. x 1 +x 2 +x 3 +x 4 ≥ 0 x 1 +x 2 -x 3 -x 4 ≥ 1 x 2 , x 3 ≥ 0 x 1 , x 4 ≤ 0. 1. Unique pr

(a) Define a procedure (subsets x) that takes a list as a single argument and returns all 2^n subsets of that list, i.e. the power set of the list; e.g. (subsets '(a b c)) ==> (

1. Write a function that converts a character array to a signed decimal integer. Function prototype must be as follows: int asciiToInt( char *str, unsigned char* eflag) YOU MAY NO

Each of the following two procedures defines a method for adding two positive integers in  terms of the procedures inc, which increments its argument by 1, and dec, which decrement

Write a program (calculation.ccp) to allow the user to perform an arithmetic operation on the two complex numbers entered.  The user can key in one of the four operations: addition