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

Python, Write a python script that will take two file names as input (src, ...

Write a python script that will take two file names as input (src, dest). Open src reading each line in the file, and replacing any occurrences of name with the string "redacted".

Mvc architecture, MVC Architecture Model/view/controller (MVC) is a program...

MVC Architecture Model/view/controller (MVC) is a program structure, currently regarded an executive design used in program technological innovation. The design isolates "domain lo

Application for a mid , The assignment has two parts: first you generate a ...

The assignment has two parts: first you generate a simple application for a MID that operates independently of other MIDs. As a second part, the application is extended to keep so

Explain inheritance and polymorphism in lingo programming, Question: (a...

Question: (a) Explain the concepts of Inheritance and Polymorphism in Lingo programming. (b) Write short descriptions on parent scripts and child objects in Lingo object

Output for the following instruction if CX=9087H AX=9090H, What will be the...

What will be the output for the following instruction if CX=9087H and AX=9090H? 1) BTR AH,2? 10010000=10010000 2) BTC CX,9?1001000010000111=1001000110000111 3) NEG AX?

Shopping Cart, Shopping Cart Purpose – Allows user to browse while keeping ...

Shopping Cart Purpose – Allows user to browse while keeping track of the items in which they will purchase at the end on the order page link and this will give a final price for al

Pros and cons of Assembly language, What are the main pros and cons of asse...

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

What is dynamic binding, Dynamic Binding: - Binding refers to the linking ...

Dynamic Binding: - Binding refers to the linking of a procedure call to the code to be executed in response to the call. Dynamic binding (late binding) means that the code associa

Program to output a triangle wave, 1.) Write a flowchart and program to do ...

1.) Write a flowchart and program to do the following: A pressure sensor in a cooling system measures the pressure of the refrigerant and is connected to Port -1 of the 8051. If th

Assignment about prolog, Hi I have an assignment for prolog languagle is ...

Hi I have an assignment for prolog languagle is it possible to get help

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