write a program in QBASIC to take input a number and print all the odd factors of that number . [THE ODD FACTORS OF 10 ARE 1 AND 5]
Answers
Answered by
1
Question:-
- Write a program in QBASIC to take input a number and print all the odd factors of that number.
Program:-
CLS
INPUT "ENTER A NUMBER: ",A
PRINT "THE ODD FACTOR(S) IS/ARE "
FOR I = 1 TO A STEP 1
IF A MOD I=0 THEN
IF I MOD 2=1 THEN
PRINT I+" "
END IF
END IF
NEXT I
END
Similar questions