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

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

Posted Date: 9/26/2012 4:32:11 AM | Location : United States







Related Discussions:- Shell script to print multiplication table of given number, Assignment Help, Ask Question on Shell script to print multiplication table of given number, Get Answer, Expert's Help, Shell script to print multiplication table of given number Discussions

Write discussion on Shell script to print multiplication table of given number
Your posts are moderated
Related Questions
showing work Ubuntu system or either opensuse

MVC Framework The ASP.NET MVC Structure is a web program framework that tools the model-view-controller (MVC) design. According to ASP.NET, it allows application designers to devel

ADO. NET ADO.NET (ActiveX Information Things for .NET) is a set of programs elements that developers can use to accessibility data and data solutions. It is an element of the platf

Please explain about sub programming.

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

write a program to draw a cow. Now, draw a cow standing amongst the grass, with (say) 500 blades of grass. Each blade of grass should be a separate random green line. Do all your d

This is what I have so far def root_brent(f, a, b, errorlimit = tinyerror, n = -1, r_i = 0): # f(a) and f(b) must have opposite signs poly = remove_multiple_roots(poly) counter

Write a program to display some data in bar graph form. Have at least 20 elements, which can be positive or negative; draw each element with a vertical bar, going up if the data is

what is java

Write and test a simple perl program on the linux platform.  You may use any linux system you wish, including the Suse linux installed in the lab. Activities. Note:  to r