Displays the number of days in a month.

Source: Internet
Author: User
Import Java. util. extends; public class days {public static void main (string [] ARGs) {extends input = new evaluate (system. in); int day = 0; system. out. println ("Enter the year:"); int year = input. nextint (); system. out. println ("Enter the month:"); int month = input. nextint (); If (0 <month & month <12) {If (month = 1 | month = 3 | month = 5 | month = 7 | month = 8 | month = 10 | month = 12) {day = 31;} e LSE if (month = 4 | month = 6 | month = 9 | month = 11) {day = 30 ;} else {If (Year % 4 = 0 & amp; Year % 100! = 0 | year % 400 = 0) {day = 29;} else {day = 28;} system. out. println (Year + "year" + month + "month" + day + "day");} else {system. out. println ("Enter 1-12 ");}}}

Enter the year and month to display the number of days of the month.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.