Write a program that will prompt the user to enter number of hours. It computes and display the number of weaks, days and hours | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
- 2

Write a program that will prompt the user to enter number of hours. It computes and display the number of weaks, days and hours

vedio lecture

22nd Jul 2019, 10:34 AM
Rana Amjad
Rana Amjad - avatar
7 Answers
+ 4
If you need help with that program, please show your own attempt on the task first, so we can help you with it.
22nd Jul 2019, 10:40 AM
Shadow
Shadow - avatar
+ 1
Your program had a lot of small errors, for example main() must return int instead of void, and most methods are written in lowercase, not uppercase. I corrected all the mistakes I could find, now it should work properly: https://code.sololearn.com/cjp9gqOitKC2/?ref=app
22nd Jul 2019, 11:27 AM
Shadow
Shadow - avatar
0
#include <iostream.h> #include <conio.h> Void main () { Clrscr(); Int hrs, W, d; Cout <<"Enter number of hours:"; Cin>>hrs; W= hrs/168; hrs = hrs /168; d = hrs /24; hrs = hrs %24; Cout<<"Weeks :"<<w<<end; Cout<<"Days : "<<d<<end; Cout <<"Hours :"<<hrs; getch(); }
22nd Jul 2019, 11:09 AM
Rana Amjad
Rana Amjad - avatar
0
Do you mean a video explaining the program? That is something I couldn't do, only try to explain it by text.
22nd Jul 2019, 11:42 AM
Shadow
Shadow - avatar
0
Plzz help me to under stand this program
22nd Jul 2019, 11:58 AM
Rana Amjad
Rana Amjad - avatar
- 1
I want to vedio lecture of this program to understand
22nd Jul 2019, 11:35 AM
Rana Amjad
Rana Amjad - avatar
- 1
How I can understand?
22nd Jul 2019, 11:58 AM
Rana Amjad
Rana Amjad - avatar