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

Similar Programs Chapter Last Updated
Java Program To Check List Having Common Values In List Interview Programs 17-05-2023
Java Program To Find Sum Of Integers Between 100 And 200 And Divisible By 7 Interview Programs 14-06-2016
Java Program To Find Minimum Of Two Numbers Using Conditional Operator Interview Programs 14-06-2016
Java Program To Print Calendar Of Month Interview Programs 13-06-2016

1