C# program to convert days to hours

Views: 442   

Following program shows you how to convert days to hours.
In this program we get days from user, once we get those we need to multiply with 24 so that we get in hours

using System;

class MainClass {
  public static void Main (string[] args) {
    Console.WriteLine ("Please enter days:");
    int days = Convert.ToInt32(Console.ReadLine());
    int hours = days * 24;
    Console.WriteLine(hours + " Hours");


Please enter days:
72 Hours
On By