CLS

INPUT "ENTER ANY NUMBER"; N

S = 0

FOR I = 1 TO N - 1

IF N MOD I = 0 THEN S = S + I

NEXT I

IF S = N THEN

PRINT "PERFECT NUMBER"

ELSE

PRINT "NOT PERFECT NUMBER"

END IF

END

USING SUB PROCEDURE

DECLARE SUB PERFECT (N)

CLS

INPUT "ENTER ANY NUMBER"; N

CALL PERFECT (N)

END

SUB PERFECT (N)

S = 0

FOR I = 1 TO N - 1

IF N MOD I = 0 THEN S = S + I

NEXT I

IF S = N THEN

PRINT "PERFECT NUMBER"

ELSE

PRINT "NOT PERFECT NUMBER"

END IF

END SUB

USING FUNCTION PROCEDURE

DECLARE FUNCTION PERFECT (N)

CLS

INPUT "ENTER ANY NUMBER"; N

PR = PERFECT (N)

IF PR = N THEN

PRINT "PERFECT NUMBER"

ELSE

PRINT "NOT PERFECT NUMBER"

END IF

END

FUNCTION PERFECT (N)

S = 0

FOR I = 1 TO N - 1

IF N MOD I = 0 THEN S = S + I

NEXT I

PERFECT = S

END FUNCTION

## No Comments