subject

Write a program segment that decides whether a given year is a leap year or not. a year is a leap year if it is divisible by 4, except for the case when it is also divisible by 100 and not by 400 hundred. so, for example, 1999 is not a leap year because it is not divisible by 4; 2000 is a leap year because it is divisible by 4 and although it is divisible by 100, it is also divisible by 400; 1900 however, is not a leap year because it is divisible by 100 and not by 400. finally, 2004 is a leap year because it is divisible by 4 and not by 100. your code should use an int named year for comparisons and print "leap year" if the value in year is a leap year and "not a leap year" if it is not. hint: you will need to use nested if statements in this code!

ansver
Answers: 2

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 04:30
How can you know if the person or organization providing the information has the credentials and knowledge to speak on this topic? one clue is the type of web site it is--the domain name ".org" tells you that this site is run by a nonprofit organization.
Answers: 2
question
Computers and Technology, 22.06.2019 14:00
What are procedures that keep a data base current
Answers: 1
question
Computers and Technology, 22.06.2019 20:00
The blank button automatically displays next to the data when you select a range of numeric data which is an available option for creating a chart
Answers: 3
question
Computers and Technology, 23.06.2019 21:20
For positive constants a and b, the force between two atoms in a molecule is given f(r) = −a r2 + b r3 , where r > 0 is the distance between the atoms. note: a and b are upper case letters. (a) find f '(r) = (b) find the critical point for f(r). r = (c) find f ''(r) = (d) find the value of r so that f ''(r) = 0.
Answers: 1
You know the right answer?
Write a program segment that decides whether a given year is a leap year or not. a year is a leap ye...
Questions
question
Mathematics, 27.03.2020 23:13
question
Biology, 27.03.2020 23:13
question
Mathematics, 27.03.2020 23:13
question
Mathematics, 27.03.2020 23:13
Questions on the website: 13722362