Computer Science, asked by Deekahithabv, 1 year ago

write a program in Java to accept the number of days and display it after converting it into number of years months and days ​

Answers

Answered by Raghuroxx
92

Answer:

Program:-

import java.util.Scanner;

public class Year_Week_Day

{

public static void main(String args[ ])

{

int m, year, week, day;

Scanner s = new Scanner(System.in);

System.out.print("Enter the number of days:");

m = s.nextInt();

year = m / 365;

m = m % 365;

System.out.println("No. of years:"+year);

week = m / 7;

m = m % 7;

System.out.println("No. of weeks:"+week);

day = m;

System.out.println("No. of days:"+day);

}

}

Explanation:

hope it's help you‼️‼️☑️☑️

Answered by prajapatipiya75
10

Explanation:

.

.

.

hope it helps

.

.

.

plz Mark me brainlist ☺️

Attachments:
Similar questions