Write a qbasic program to display the factors and sum of factors for an input number.

Write a qbasic program to display the factors and sum of factors for an input number.

Ans:
CLS
INPUT "Enter a number ";n
FOR j=1 TO n
       IF n MOD j=0 THEN 
              PRINT j
              Sum=Sum+j
       END IF
NEXT j
PRINT "Sum of factors ";Sum
END