Write Bash Shell Script Display Multiplication Table Row Columns 1 12 Using Nested C Style Q37150027

Write a bash shell script to display a multiplication table (rowand columns 1-12) using nested C style for loops


Solution


#!/bin/bash

for (( i = 1; i < 13; ++i )); do
for (( j = 1; j <= 10; ++j )); do
    printf ‘%dx%d=%-2d ‘ “$i” “$j” “$(( i * j))”
done
printf ‘n’
done

codingground 23456789 Execute Bash Shell Online (GNU Bash v4.4) 662 : Fork-a Project ▼ 28406284, Edit ▼ * Setting ▼ 홅 Login 0

codingground 23456789 Execute Bash Shell Online (GNU Bash v4.4) 662 : Fork-a Project ▼ 28406284, Edit ▼ * Setting ▼ 홅 Login 024 웡Execute!>

OR
OR

Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.