Answer :
#include<stdio.h> //header file contains the function,decleraction and macro defination of key words used in code.
int main ()
{
int year; //adressing the variables
printf("Enter an year you want"); //output
scanf("%d",&year); //stores the input from the user
if (year%100==0) //condition //nested if - else
{
if (year%400==0) //condition
printf("%d is a leap year",year); //output
}
else
{
if (year%4==0) //condition
{
printf("%d is a leap year",year); //output
}
}
}
Output :
0 Comments