VelizarAvramov

01. Centuries to Minutes

Nov 5th, 2018
107
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.62 KB | None | 0 0
  1. using System;
  2.  
  3. namespace _01._Centuries_to_Minutes
  4. {
  5.     class CenturesToMinutes
  6.     {
  7.         static void Main(string[] args)
  8.         {
  9.             //Write program to enter an integer number of centuries and convert it to years, days, hours and minutes.
  10.             int centures = int.Parse(Console.ReadLine());
  11.  
  12.             int years = centures * 100;
  13.             int days = (int)(years * 365.2422);
  14.             int hours = days * 24;
  15.             int minutes = hours * 60;
  16.             Console.WriteLine($"{centures} centuries = {years} years = {days} days = {hours} hours = {minutes} minutes");
  17.         }
  18.     }
  19. }
Advertisement
Add Comment
Please, Sign In to add comment