Shell script to print multiplication table of given number, Programming Languages

Assignment Help:

4.      Write a shell script to print the multiplication table of given number up to a given range.

 

Program

 

# Write a shell script to print the multiplication table of given number

# up to a given range.

 echo "Enter NO.:"

read no             

echo "Enter range:"

read r

i=1

 

while test $i -le $r           #starts with 1 to given range

do

   temp=`expr $no \* $i`

   echo "$no * $i = $temp"

   i=`expr $i + 1`

done

 

Output

 

Enter NO.:

5

Enter range:

6

5 * 1 = 5

5 * 2 = 10

5 * 3 = 15

5 * 4 = 20

5 * 5 = 25

5 * 6 = 30

 

Enter NO.:

15

Enter range:

4

15 * 1 = 15

15 * 2 = 30

15 * 3 = 45

15 * 4 = 60


Related Discussions:- Shell script to print multiplication table of given number

Wsdl service architecture in uml, Design the proposed implementation using ...

Design the proposed implementation using the contract first approach and object oriented approaches.  At a minimum, you must provide an overview of the services in the service arch

assembly lang. H.W, 1- Allocate array with 32bit 100 element 2- Prompt the...

1- Allocate array with 32bit 100 element 2- Prompt the user to enter the maximum or the upper bound of the random value 3- Read the value and use it generate random numbers to init

What is hiding a method? explain, Question 1 Explain the three traits of O...

Question 1 Explain the three traits of Object Oriented Programming Question 2 Write a note on (a) Assignment Operators                             b) Bitwise Operators.

Create application for a book store, You need to create a simple applicatio...

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

Programming logic???, write c++ source code to find the number of digits i...

write c++ source code to find the number of digits in a given integer? pls ans

Write out the syntax of nested if statements, Write out the Syntax of Neste...

Write out the Syntax of Nested if Statements? The universal form is                         If(expression 1)                         {

Online Business Systems, Task .Task 1 Database design This task will allow...

Task .Task 1 Database design This task will allow you to demonstrate the following Learning Outcomes (LOs): LO 2. Justify the design and development of the application and critica

Program 3, An apartment complex has several apartments to rent. The apartme...

An apartment complex has several apartments to rent. The apartments are all similar, and all rent for $750 per month. Currently, all units are occupied. The management, being in bu

Java source code classes and objects, Design and implement a stringed music...

Design and implement a stringed musical instrument class using the following guidelines: a. Data fields for your instrument should include number of strings, an array of stri

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