Time Converter from hours and minutes to seconds
<!DOCTYPE html>
<html>
<body>
<script>
// Read the hours from the user
var hours = parseInt(prompt("Please enter hours: "));
// convert it into minutes
var minutes=hours*60;
// convert it into seconds
var seconds=minutes*60;
// print the result in alert box
alert(`${hours} hours = ${minutes} minutes = ${seconds} seconds`);
</script>
</body>
</html>
Comments
Leave a comment