CONVERT DAYS TO YEARS,WEEKS AND DAYS

This is the programe we can convert the strings from uppercase to lowercase and viceversa.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18 
19
20
public class DaysToYear
{
    public static void main(String[] args)
    {
        int days,year,week,day,m;
        System.out.println("Enter the nubers of days ");
            Scanner in = new Scanner(System.in);
        day=in.nextInt();
            year=day/365;
            day=day%365;
            m=day/30;
            day=day%30;
            week=day/7;
            day=day%7;
            System.out.println("Years="+year);
            System.out.println("Months="+m);
            System.out.println("Weeks="+week);
            System.out.println("Days="+day);    
    }
}

 

Output :Days to Years

addm