Wednesday, May 20, 2020

Find leap year or not in C

  • Program :
#include <stdio.h>
int main()
{
    int year;
    printf("\n----------------LEAP YEAR OR NOT----------------"); 
    printf("Enter a year: ");
    scanf("%d", &year);
    if(year%4==0)
{
                printf("%d is a leap year.", year);
            else
                printf("%d is not a leap year.", year);
}     
    return 0;
}

  • Output :

No comments:

Post a Comment

Function Overloading in C++

https://monitechvenkat1620.blogspot.com Program : #include <iostream> using namespace std; int c(int x, int y) {   return...