W.A.P. in Java to accept the number of days and display the result after converting it into
number of years, number of months and the remaining number of days.
Answers
Answered by
0
Answer:
Write a program in Java to accept the number of days and display the result after converting into number of years, number of months and the remaining number of ...
Answered by
3
Answer:
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);
}
}
Similar questions