VOOZH about

URL: https://www.geeksforgeeks.org/dsa/program-to-convert-weeks-to-days/

⇱ Program to convert weeks to days - GeeksforGeeks


  • Courses
  • Tutorials
  • Interview Prep

Program to convert weeks to days

Last Updated : 12 Feb, 2024

Given no of weeks. Write a program to convert weeks to days.

Examples:

Input: weeks = 4
Output: 28 days

Input: 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:


Output
9 weeks is equal to 63 days.

Time Complexity: O(1)
Auxiliary space: O(1)

Comment
Article Tags:
Article Tags: