Purchase Solution

C program to determine the year entered is a leap year

Not what you're looking for?

Ask Custom Question

Write a C program to determine whether the year entered from the keyboard is a leap year. Display a message indicating whether the year is or is not a leap year.

To calculate this problem, a year is a leap year if it is evenly divisible by 4 and not by 100, or if it is evenly divisible by 400. Check the remainder of the division statements by using the % function. (Hint: It may help to have three variables, each one holding the remainder of each of the division problems.)

(To check your work, legal leap years are 1952, 1964, 1988, and 2004. Years 1953, 1966, 1990, and 2007 are not leap years.)

Purchase this Solution

Solution Summary

The solution writes a C program to determine whether the year entered from the keyboard is a leap year. The code will display a message indicating whether the year is or is not a leap year.

Purchase this Solution


Free BrainMass Quizzes
Basic UNIX commands

Use this quiz to check your knowledge of a few common UNIX commands. The quiz covers some of the most essential UNIX commands and their basic usage. If you can pass this quiz then you are clearly on your way to becoming an effective UNIX command line user.

Java loops

This quiz checks your knowledge of for and while loops in Java. For and while loops are essential building blocks for all Java programs. Having a solid understanding of these constructs is critical for success in programming Java.

Word 2010: Tables

Have you never worked with Tables in Word 2010? Maybe it has been a while since you have used a Table in Word and you need to brush up on your skills. Several keywords and popular options are discussed as you go through this quiz.

Word 2010: Table of Contents

Ever wondered where a Table of Contents in a Word document comes from? Maybe you need a refresher on the topic? This quiz will remind you of the keywords and options used when working with a T.O.C. in Word 2010.

Basic Networking Questions

This quiz consists of some basic networking questions.