#!/bin/bash
seconds=0
echo -n "Enter number of seconds > "
read seconds
hours=$((seconds / 3600))
seconds=$((seconds % 3600))
minutes=$((seconds / 60))
seconds=$((seconds % 60))
echo "$hours hour(s) $minutes minute(s) $seconds second(s)"
Seconds to hours and minutes
This program format an arbitrary number of seconds into hours and minutes:
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment