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

Write a shell script to calculate gross salary, Write a shell script  (W.A...

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

Matlab, I need to write code to compute matrix multiplication without usin...

I need to write code to compute matrix multiplication without using built in function.

Java applet assignment help, Objectives: Create an applet, Use metho...

Objectives: Create an applet, Use methods from the Graphics class , Use the Color class General Instructions: The java class that need to be imported into this assignm

Abstraction hierarchy of mechanisms, Abstraction hierarchy of mechanisms ...

Abstraction hierarchy of mechanisms Given  the light-sensitive the motor and resistor,  we could  find  several  ways  of interconnecting them, using bits of ceramic and metal

Write a program of function withdraw money, Write a function called withdra...

Write a function called withdraw (in the file 'withdraw.m') that simulates withdrawing money from a bank account. The function takes a single input argument, a positive scaler doub

programming assignment using perl, This assignment is an individual progra...

This assignment is an individual programming assignment using Perl. It addresses objectives 3, 4, 5 and 8 as listed in the Subject Outline document. The assignment is based on them

Database, asample database report

asample database report

Advance microprocessor, Write a program to mask bits D3D2D1D0 and to set bi...

Write a program to mask bits D3D2D1D0 and to set bits D5D4 and to invert bits D7D6 of the AX register.

Arithmetic involving matrices, We next require taking a look at arithmetic ...

We next require taking a look at arithmetic involving matrices. We'll begin with addition and subtraction of two matrices. Therefore, assume that we have two n x m matrices, which

Web services information language, Web Services Information Language WCF is...

Web Services Information Language WCF is designed using assistance focused structure concepts to support allocated processing where solutions have distant customers. Customers can

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