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
Write a program that inputs two positive integers of, at most, 20 digits and outputs the sum of the numbers. If the sum of the numbers has more than 20 digits, output the sum with

What are the main pros and cons of assembly programming language?

On-line fair and ethical share trading system (Olfest) A system is required that allows on-line customers to buy and sell stock market shares in a selection of companies. B

Select two different architecture styles to design and implement a software system and provide its Architecture Diagrams (implement the software with java)

Normal 0 false false false EN-US X-NONE X-NONE MicrosoftInternetExplorer4

XYZ International is a large Institute; Management in this institute wants to create Proper Student management System. There for they contact you and asked you to create Propto typ

You need to create a simple application for the Note Plus book Store. The interface for the application is shown below:   REQUIRED: 1)  Create all necessary contro

can i get assignments on Data analytics?


How to do socket programming in C