Loading…
OS · Loops & numbers · Program 13 · In the record
Write a shell script to print the multiplication table of the input term
1#!/bin/bash2 3echo "Enter a number:"4read n5 6for (( i = 1; i <= 10; i++ ))7do8 echo "$n x $i = $((n * i))"9done7Enter a number: 7 7 x 1 = 7 7 x 2 = 14 7 x 3 = 21 7 x 4 = 28 7 x 5 = 35 7 x 6 = 42 7 x 7 = 49 7 x 8 = 56 7 x 9 = 63 7 x 10 = 70
Run program 13 in your browser
bash · just-bash. Change the code or the input, run it, break it, and see what happens.