C++ program to convert days to hours

Views: 106   

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

#include <iostream>
#include <math.h>

int main() {
    int days;
    std::cout << "Please enter days:";
    std::cin >> days;
    int hours = days * 24;
    std::cout << hours << " Hours";


Please enter days: 15
360 Hours
On By