-----------------------------Script--------------------------- echo -e "Enter the Distance Between 2 cities : \c" read distance meter=`expr $distance \* 1000` centi=`expr $meter \* 100` inch=`echo -e "scale=2 \n $centi / 2.5" | bc` feet=`echo -e "scale=2 \n $inch * 12" | bc` echo "Meter = " $meter echo "Centimeter = " $centi echo "Inch = " $inch echo "Feet = " $feet -----------------------------output--------------------------- Enter the Distance Between 2 cities : 2 Meter = 2000 Centimeter = 200000 Inch = 80000.00 Feet = 960000.00 -----------------------------END------------------------------
Home
Uncategories
The distance between two cities is input through the keyboard (in km). Write a program to convert this distance into metres, feet, inches and centimeters and display the results.
- Blogger Comment
- Facebook Comment
Subscribe to:
Post Comments
(
Atom
)
0 comments:
Post a Comment