A program that reads two positive integers corresponding to two year values. It ensures that the first year value is less than the second. It then determines and outputs all year values for leap years.
A program that reads two positive integers corresponding to two year values. It ensures that the first year value is less than the second. It then determines and outputs all year values for leap years.
A program that reads two positive integers corresponding to two year values. It ensures that the first year value is less than the second. It then determines and outputs all year values for leap years.
* * Nurul Amirah Bt Mohammed Noor(CE093474) * * Course: CSEB113 * * Section: 05B * * Date:31/7/15 * * Brief description:A C programthat reads two * * positive integers corresponding to two year * * values, ensures that the first year value is * * less than the second, * * and then determines and outputs all year values for * * leap years. * ******************************************************/ #include <stdio.h> int main(void) { int year0,year1, year; printf("Enter the starting year and the ending year\n"); printf("The value for the starting year must be less than the value for the ending year\n"); printf("\nEnter year1:"); scanf("%d", &year1); printf("\nEnter year:"); scanf("%d", &year); if (year1 > year) { printf("\nThe value for the starting year must be less than the value for the ending year\n"); printf("\nEnter year1:"); scanf("%d", &year1); printf("\nEnter year:"); scanf("%d", &year); } printf("\n\nThe following are the leap year<s> between %d and %d\n\n", year1, year); for (year0 = year1;year0 <= year;year0++) { if (((year0 % 4 == 0) && (year0 % 100 != 0)) || (year0 % 400 == 0)) printf("%d\t", year0); }
Learn Python Programming for Beginners: Best Step-by-Step Guide for Coding with Python, Great for Kids and Adults. Includes Practical Exercises on Data Analysis, Machine Learning and More.
The Advanced Roblox Coding Book: An Unofficial Guide, Updated Edition: Learn How to Script Games, Code Objects and Settings, and Create Your Own World!