Date

 Date

Problem Description


Write a Java program to convert minutes into a number of years and days.


Test Data


Input the number of minutes: 3456789


Expected Output :


3456789 minutes is approximately 6 years and 210 days


Solution;


import java.util.Scanner;

import java.io.*;

public class TestClass {

public static void main(String[] args) { 

Scanner sc= new Scanner(System.in); 

      int Min= sc.nextInt();

       int years=(Min /(60 * 24 * 365));

       int days= (Min /60/24)%365;

System.out.println(+years);  

System.out.println(+days);  

     }

}

Post a Comment

0 Comments