Java Program To Convert Number Of Days Into Months And Days
Chapter:
Interview Programs
Last Updated:
14-06-2016 16:47:32 UTC
Program:
/* ............... START ............... */
public class JavaNumberOfDaysToMonthAndDay {
public static void main(String args[]) {
int num = 73;
int days = num % 30;
int month = num / 30;
System.out.println(num + " days = " + month + " Month and " + days + " days");
}
}
/* ............... END ............... */
Output
73 days = 2 Month and 13 days
Tags
Convert Number Of Days Into Months And Days, Java, Interview Programs