![]() |
VOOZH | about |
Given no of weeks. Write a program to convert weeks to days.
Examples:
Input: weeks = 4
Output: 28 daysInput: weeks = 2
Output: 14 days
Approach: To solve the problem, follow the below idea:
Since we know a week has 7 days. So, to find no of days in a week, we multiply weeks by 7.
1 week = 7 days
n weeks = n*7 days
Below is the implementation of the above approach:
9 weeks is equal to 63 days.
Time Complexity: O(1)
Auxiliary space: O(1)