0% found this document useful (0 votes)
3 views

PPS Assignment 2A

Pps assignment

Uploaded by

bimaladave13
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
3 views

PPS Assignment 2A

Pps assignment

Uploaded by

bimaladave13
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 2

Assignment No.

: 2-A
Name.: Rawat Shweta Dayal Singh
Class.: R FY(BTECH-AIML)
Roll no.: 17051
============================================

Title.: Write a C program to determine whether the year is a


leap year or not.
Course Outcome.: CO1 Write a program using basic language
constructs decision structures for solving the given problem.

============================================
INPUT
/*Write a C program to determine whether the year is a leap
year or not.*/
#include<stdio.h>
int main()
{
int year;
//To get the year from the user to check
printf("Enter a year : ");
scanf("%d",&year);
printf("\n=================================\n");
//Check if year is a leap year
if (year%4==0)
{
printf("\n\nThe entered year %d is a leap year",year);
}
else if (year%100==0)
{
printf("\n\nThe entered year %d is not a leap year",year);
}
else if (year%400==0)
{
printf("\n\nThe entered year %d is a leap year",year);
}
else
{
printf("\n\nThe entered year %d is not a leap year",year);
} printf("\n\
n=================================\n");
return(0);
}
OUTPUT

You might also like