Write a program to compute how many days in a million seconds
Answers
Answer:
#Python
Explanation:
second = int(input("enter seconds ")
days = seconds/86400
print(days)
10,00,000 sec = 11.5736 days
Explanation:
Logic
We must understand the hierarchy of time
seconds-->minute-->hours-->days
To convert from seconds to minute, we divide seconds by 60
1,000,000 seconds / 60 = 16,666.667 minutes
To convert from minute to hours, we divide minute by 60
16,666.667 minutes / 60 = 277.778 hours
To convert from hours to days, we divide hours by 24
277.778 hours / 24 = 11.574 days
So let us write code according to the logic arrived,
#include<iostream.h>
using namespace std;
int sec = 1000000;
float min, hrs, days;
min = sec/ 60;
hrs = min / 60;
days = hrs / 24;
cout<<"The number of days in million seconds is "<<days;
The output will be:
The number of days in million seconds is 11.5736
To Know More:
https://brainly.in/question/4863830
C++ example maths computer
https://brainly.in/question/26265
Write a c++ program for a² + b²..using pow function in dev c++...please..