Write a QBasic program to enter any number and find sum of its factors
Answers
Answered by
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
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
English,
4 months ago
Business Studies,
9 months ago