Java program to convert given number of days into months and days

Java program to convert given number of days into months and days

class Days
{
public static void main(String…s)
{

int n,m,d;
n=Integer.parseInt(s[0]);

m=n/30;
d=n%30;

System.out.println(n+” days“+” = “+m+” months “+”and “+d+” days”);
}
}

" data-link="https://twitter.com/intent/tweet?text=Java+program+to+convert+given+number+of+days+into+months+and+days&url=https%3A%2F%2Fwww.thecrazyprogrammer.com%2F2013%2F08%2Fjava-program-to-convert-given-number-of.html&via=">">Tweet
16 Shares

2 thoughts on “Java program to convert given number of days into months and days

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.