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

Assignment Help:

 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.


Related Discussions:- Write a shell script to find the maximum of three numbers

Create a directory, The ?rst task in the project is to develop a sane syste...

The ?rst task in the project is to develop a sane system to store change logs and versions of ?les. The simplest approach is to create a "dot" directory in the location of the ?le

Created xml document using the css stylesheet, After studying the concept, ...

After studying the concept, terminology, and implementation of CSS stylesheets, create a stylesheet to accompany your solutions to Question 1. A rich collection of styles should be

Write a perl script to assign letter grades to the students, Tasks: Writ...

Tasks: Write a Perl script assignGrades.pl to assign letter grades to the students. Please use the classList2.txt file. Upon invoking, the script will access the file classL

Matlab, ,how to write matlab program for fast decoupled method

,how to write matlab program for fast decoupled method

Explain the different states of activity diagram, Question 1 Discuss on In...

Question 1 Discuss on Inheritance Question 2 What are the four phases of the object modeling technique that can be repetitively executed? Question 3 Explain the di

Create a structure that will represent a deck of cards, We want to create a...

We want to create a structure that will represent a deck of cards  (not necessarily full). Each card has a character (between  '2'  to  '9' and  'T',  'J',  'Q',  'K',  'A') and a

Read Multiple Text Files, How to read datasets in multiple text files in an...

How to read datasets in multiple text files in an non interactive program?

Create a raptor program - use class in raptor and in python, In this porti...

In this portion of the lab you will analyze a problem and create a Raptor program to solve it.  Make sure you use a class in Raptor and in Python to solve the problem.  Read the fo

Controlling stepper motor through rtlinux, In this project, we have measure...

In this project, we have measured and compared the performance given by RTLinux, which is real time system with non-real time Linux operating system. Also, we have measured the

Write Your Message!

Captcha
Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd