Home Man
Today's Posts

Students must use and complete the template provided. If you do not use the template your post may be deleted! Special homework rules apply here.

Multiplication Table in UNIX

multiplication, scripting, shell, table, unix

Login to Reply

Thread Tools Search this Thread
# 1  
Old 07-13-2016
Multiplication Table in UNIX

How can I produce this kind of output?

Enter a number: 3

0 1 2 3
1 1 2 3
2 2 4 6
3 3 6 9

When you enter a number, it should show you the corresponding multiplication table. Plus we need to use for loops that I do not actually know. Thanks in advance! Here is my code

echo Enter a number:
read num
while [ $num –le 5 ]
res=`expr $num \* $iter`
echo $num “*” $iter “=” $res
iter=`expr $iter + 1`
# 2  
Old 07-13-2016
Do not post classroom or homework problems in the main forums. Homework and coursework questions can only be posted in this forum under special homework rules.

Please review the rules, which you agreed to when you registered, if you have not already done so.

More-than-likely, posting homework in the main forums has resulting in a forum infraction. If you did not post homework, please explain the company you work for and the nature of the problem you are working on.

If you did post homework in the main forums, please review the guidelines for posting homework and repost.

Thank You.

The UNIX and Linux Forums.
# 3  
Old 07-13-2016
Fill in the entire questionnaire compulsory for homework (see rules).
The Following User Says Thank You to RudiC For This Useful Post:
larkha (07-14-2016)
Login to Reply

« Previous Thread | Next Thread »
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
How to lock Oracle table through UNIX? gnnsprapa Shell Programming and Scripting 3 10-15-2013 03:34 AM
How to sort matrix table in UNIX? sureshk_85 Shell Programming and Scripting 2 03-01-2013 10:01 AM
Hash Table like implementation in unix anindyabecs UNIX for Dummies Questions & Answers 8 05-25-2011 03:44 PM
Create a table - very new to unix aj250 UNIX for Dummies Questions & Answers 11 07-19-2010 04:31 PM
Error with "multiplication table" in shell script vinodpaw Shell Programming and Scripting 4 03-22-2010 06:27 AM
nested loop:multiplication table killboy UNIX for Dummies Questions & Answers 1 10-15-2009 11:33 PM
Creating table in Unix mr_manii Shell Programming and Scripting 7 10-01-2009 09:17 AM
updating a column in a unix table for a particular row thanuman Shell Programming and Scripting 5 02-09-2009 05:52 PM
unix file to oracle table ran16 Shell Programming and Scripting 2 06-14-2008 02:27 PM
how to view symbol table in unix saravanan_nitt Programming 1 02-14-2008 12:02 AM

All times are GMT -4. The time now is 05:51 AM.

Unix & Linux Forums Content Copyright©1993-2018. All Rights Reserved.
Show Password