Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 2

FA1.2 Laboratory Exercise No.

Tricia Ann Bernadette C. Radovan

CS-O/FOPM02

1. Selection - Leap Year

FLOWCHART

PSEUDOCODE

Variable used

yr is numeric

Begin

Display “Enter a Year: ”

Accept yr

If (yr%400==0) then

Begin

Display “A LEAP YEAR”

End

Else if (yr%100!=0) then

Begin

If (yr%4==0) then

Display “A LEAP YEAR”

Else

Display “NOT A LEAP YEAR”

End

Else

Display “NOT A LEAP YEAR”

End
FA1.2 Laboratory Exercise No.2

2. Iterative - Factors of a
Number

FLOWCHART
PSEUDOCODE

Variables used

ctr, n are numeric

Begin

Display “Enter a Number: ”

Accept n

ctr=0

If (n>0) then

Begin

Display “Its Factors are: ”

While (ctr < n) do

Begin

ctr = ctr + 1

If (n%ctr==0) then

Display ctr

End

End

End

You might also like