Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace ScriptCSharp
- {
- class Program
- {
- static void Main(string[] args)
- {
- /*Exercício 45 - Leia um valor inteiro em segundos, e depois mostrá-lo em horas, minutos
- e segundos. */
- Console.Write("Digite uma quantidade de segundos: ");
- double segundos = double.Parse (Console.ReadLine());
- double h = segundos / 3600;
- double resto = segundos % 3600;
- double m = resto / 60;
- double s = resto % 60;
- Console.Write("Em horas: "+ h + "\nEm minutos: "+ m + "\nEm segundos: "+ s);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement