GTU OS Program - 16 Multiplication Table Generator

16. Write a shell script to display multiplication table of given a number.

Start by creating a new file called multi_table.sh using vim

Complete code of the program

  1. echo "Multiplication Table "
  2. read -p "Enter the number : " n
  3. i=0
  4. for((i=1;i<11;i++))
  5. do
  6. echo "$n X $i = " "`expr $n \* $i`"
  7. done
  8.  

Interpreting the multi_table.sh file and executing it in terminal

  1. tkanu025@hp:~/lab_solutions$ chmod +x multi_table.sh
  2. tkanu025@hp:~/lab_solutions$ ./multi_table.sh
Output
16. Write a shell script to display multiplication table of given number gtu study material for engineering students

gtu os lab manual,

os GTU Practical,

operating system Programs,

Operating system shellscript programs,

Gtu study material 3140705,

OS 3140702,

os practical list,

shell script programming,

gtu os practical,

os lab solution gtu

Comments

YouTube

Popular posts from this blog

GTU OS Program - 11 Filters

GTU OOP Program - 17 tic-tac-toe

GTU OS Program - 13 Date Validator