Write the program that will convert the input inches into its equivalent centimeter 1 inch is equivalent to 2.56 centimeter then display the result?

1 answer

Answer

1046646

2026-08-09 17:25

+ Follow

#!/bin/bash

#Convert Inches to Centimeters in BASH

cm=0;

echo "Please enter the number of inches. ";

read inch;

cm=echo "$inch * 2.56" | bc

echo "There are $cm centimeters in $inch inches";

exit;

ReportLike(0)ShareFavorite

Copyright © 2026 eLLeNow.com All Rights Reserved.