Loading…
OS · First scripts · Program 14 · In the record
Write a shell script to print the circumference of the circle.
1#!/bin/bash2 3echo "Enter the radius of the circle:"4read r5 6circumference=$(echo "scale=2; 2 * 3.14 * $r" | bc)7 8echo "Circumference of the circle = $circumference"7Enter the radius of the circle: 7 Circumference of the circle = 43.96
Run program 14 in your browser
bash · just-bash. Change the code or the input, run it, break it, and see what happens.