Posts

Showing posts with the label even number

C program Leap year or not and Odd or Even

It is a program to find a year given by user is leap year or not . The input integer, year is read from user verified by modulus operator and condition statement. If the condition is satisfied, the year is leap year, otherwise it is not a leap year. Year is leap or not if the given year divided 4 and returns reminder 0, it is leap year, otherwise not leap year READ year reminder = year modulus 4 if reminder == 0, PRINT it is leap year else PRINT it is not leap year end Year is leap or not - C program The C program finds a given year is leap or not # include <stdio.h> # include < string .h> int main () { int year; int reminder=0; printf ("\n Find a given year is Leap year or not "); printf("\n Enter a Year :" ); scanf("%d", &year); reminder = year % 4; i...