0

Guys what the code needs to run properly ?

#include<iostream> main() { cout << "please enter the number: "; int num; cin >> num; int num1; num1 = num / 86400; cout << "the number in days= " << num1 << endl;; int num2; num2 = num - (num1*86400) ; num2 = num2 / 3600; cout << "the number in hours= " << num2<<endl; int num3; num3 = num- (num1*86400 ) - (num2 * 3600); num3 = num3 / 60; cout << "the number in min= " << num3 << endl; int num4; num4 = num - (num1 * 86400) - (num2 * 3600) - (num3 * 60); cout << "the number in seconds= " << num4 << endl; cin >> num; int k ; cin>>k ; }

31st Mar 2021, 1:04 PM
Sohaib Ahmad Al-naimat
Sohaib Ahmad Al-naimat - avatar
7 Respuestas
+ 2
not sure what your problem is... maybe specify more?
31st Mar 2021, 1:09 PM
Rellot's screwdriver
Rellot's screwdriver - avatar
0
I need to write complet c++ program ..input integer and convert it to days,hours,minute, and second.. What should I fill in the code to give the required result?
31st Mar 2021, 1:19 PM
Sohaib Ahmad Al-naimat
Sohaib Ahmad Al-naimat - avatar
0
Unit in seconds
31st Mar 2021, 1:41 PM
Sohaib Ahmad Al-naimat
Sohaib Ahmad Al-naimat - avatar
0
Can you adjust it so that I enter the number of days, not seconds ... and add months too, please! 😅
31st Mar 2021, 2:40 PM
Sohaib Ahmad Al-naimat
Sohaib Ahmad Al-naimat - avatar