Write a C program to find whether a given year is a leap year or not.
#include
Int main()
{
int year;
printf("Input a year :");
scanf("%d", &year);
if ((year % 400) == 0)
printf("%d is a leap year.\n", year);
else if ((year % 100) == 0)
printf("%d is a not leap year.\n", year);
else if ((year % 4) == 0)
printf("%d is a leap year.\n", year);
else
printf("%d is not a leap year \n", year);
return 0;
}
WorldTimeTech provides Movie News, Troubleshooting, and Programming knowledge. Thank You...
Copyright © 2023 WorldTimeTech.com All Rights Reserved.