Now, let's change the year to The output will be is a leap year. Since is divisible by 4, it is a leap year. Share on:. Did you find this article helpful?
Sorry about that. How can we improve it? Leave this field blank. Related Examples. Java Example Add Two Dates. Java Example Check if two of three boolean variables are true. Get App Get Java App. Please use ide. Load Comments. What's New. Most popular in Java. Most visited in Java Programs. We use cookies to ensure you have the best browsing experience on our website.
Start Your Coding Journey Now! Viewed times. The only requirement is using a while or do-while loop. I am stuck. Abetheshooter Abetheshooter 35 3 3 bronze badges. I'm sorry to hear you are stuck, but it's hard to help you if you don't tell us where you are stuck. You need to do some digging on your own and figure out exactly what it is you need help with, and then ask about that.
If we just wrote the program for you, you wouldn't learn any new concepts, and then you would be even more stuck on your next assignment. Most importantly Im stuck on figuring how to my the loop run again because I'm able to find out whether it is a leap year or not but when asked to continue I'm not sure how to make the input run again and ask the users for a new year!
You ask the user a question and capture the response in variable yes , then never use it for anything. As a user, I'd get really mad at your program for ignoring my response.
Add a comment. Active Oldest Votes. Mustafa Poya Mustafa Poya 1, 1 1 gold badge 13 13 silver badges 25 25 bronze badges. Create a free Team What is Teams? Collectives on Stack Overflow. Learn more. Asked 1 year, 4 months ago. Active 1 year, 4 months ago.
Viewed times. Turing85 Sedrido Sedrido 23 3 3 bronze badges. Your logic doesn't make sense. You print "Leap year! Yes -- this isn't really a programming problem, as such, but a matter of understanding the logic.
0コメント