Computer Science, asked by ujagar8515, 9 months ago

Write a QBasic program to enter any number and find sum of its factors

Answers

Answered by EliteDaMyth
9

CLS

INPUT "ENTER ANY NUMBER"; N

S = 0

FOR I = 1 TO N

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

NEXT I

PRINT "SUM OF FACTORS="; S

END

Answered by indrashisg
1

Answer:

REM SUM OF FACTORS OF A NUMBER

CLS

INPUT N

FOR I=1 TO N

IF N MOD I=0 THEN

SUM=SUM+I

ENDIF

NEXT I

PRINT SUM

END

Similar questions