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
program take integer from user and print in alphabets


Task 1 Think about a Web site you would like to work on for Assignment 2. For example, you can do a personal interest site, a site for your favourite nonprofit organization,

Find out the selling cost average for packages developed in Pascal

Often, DNA sequences are represented as a sequence of characters (String) and each character in the sequence corresponds with one of four nucleotides. A = adenine, C = cytosine,

Write a shell script  (W.A.S.S) to calculate gross salary. Program # Write a shell script  (W.A.S.S) to calculate gross salary. echo "Enter any Basic Salary"     #echo is

Shemrock Inc. is a brake pad manufacturing company. This company uses raw materials, such as carbon powder, iron, ash, and resin. It wants to develop an inventory management system

Explain, in your own words, how web designers can deal with CSS conflict resolution. What is the order of precedence between the different types of CSS (inline, embedded and extern

Your solution to the problem should be housed within a while loop, which allows the grader to test your solution repeatedly without having to re-execute the script, as shown in cla

W.A.S.S to find the factorial of a given number. Program # W.A.S.S to find the factorial of a given number.    echo -e "enter number:\c"            #  \c Suppress trailing n