Search Your Keyword

A One Massage for users

C Program BD say you

Hi, If you are new in our blog and to get support about C program, than you must select your level from right side in this blog.Such as, If you want to learn than you select Entry Level for learning and If you are known the basic of C program than you select Solution Level.


Saturday, September 14, 2019

Q6. Write a C program that takes a year as input and displays whether the given year is leap year or not.

C program to find inputted year is leap year or not:-
#include<stdio.h>
#include<conio.h>

void main()
{
int year;
clrscr();

printf("Enter a year:-");
scaf("%d", &year);



if(((year%4)==0) && ((year%100)!=0) || ((year%400)==0)}
{
printf("\n %d Is a leap year.", year);
}

else
{
printf("\n %d Is not a leap year.", year);
}

getch();
}

Year is leap year or not find it by C program

C program to find inputted year is leap year or not,

No comments:

Post a Comment