0% found this document useful (0 votes)
5 views5 pages

Practical No 5

The document outlines a practical assignment by Maheen Farooqi to write a program that determines if a given year is a leap year. It includes an algorithm, flowchart, and source code in C programming language. The program checks if the year is divisible by 4 to conclude if it is a leap year or not.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
5 views5 pages

Practical No 5

The document outlines a practical assignment by Maheen Farooqi to write a program that determines if a given year is a leap year. It includes an algorithm, flowchart, and source code in C programming language. The program checks if the year is divisible by 4 to conclude if it is a leap year or not.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 5

NAME: MAHEEN FAROOQI GR: 112

PRACTICAL NO: 1

OBJECT:

Write a program that inputs a year and finds if


it is leap year or not.

23
NAME: MAHEEN FAROOQI GR: 112

ALGORITHM:

STEP # 1: Start the program.


STEP # 2: Declare the variable y.
STEP # 3: Read the variable y.
STEP # 4: if(y % 4 == 0).
STEP # 4(a): Then write it is a leap year.
STEP # 4(b): Else write it is not a leap year.
STEP # 6: Stop the program.

24
NAME: MAHEEN FAROOQI GR: 112

FLOWCHART:

25
NAME: MAHEEN FAROOQI GR: 112

SOURCE CODE:
#include<stdio.h>
#include<conio.h>
void main(void)
{
clrscr();
int y;
printf("\nEnter any Year:");
scanf("%d",&y);
if(y%4==0)
{
printf(" ____________________");
printf("\n|%d is a leap year!|",y);
printf("\n|____________________|");
}
else
{
printf(" ________________________");
printf("\n|%d is not a leap year!|",y);
printf("\n|________________________|");
}
getch();
}

OUTPUT:
26
NAME: MAHEEN FAROOQI GR: 112

 Inputted year is a leap year:

 Inputted year is not a leap year:

27

You might also like