Write a program Java to display total numbers of months and days for given days. - Pratik Ghelani

Pratik Ghelani

Breaking

Friday, January 25, 2019

Write a program Java to display total numbers of months and days for given days.

Program:-

public class p3a {
public static void main(String[] args)
{
int n=999,months,days;
months=n/30;
days=n%30;
System.out.println(n+" = "+months+" Months and "+days+" Days");
}

}

Output:-




No comments:

Post a Comment