(Assume that each month is of 30 days) Example : Input - 69 Output - 69 days = 2 Month and 9 days */ class DayMonthDemo{ public static void main(String args[]){ int num = Integer.parseInt(args[0]); int days = num%30; int month = num/30; System.out.println(num+" days = "+month+" Month and "+days+" days"); } }
JAVA LEARNING:An art and entertainment for those who love it. For Online Assistance and help @email:Learnprogramm@gmail.com
Thursday, 28 April 2011
Java program to convert given no. of days into months and days
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment