Computer Science, asked by TiasaDas, 5 months ago

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 anindyaadhikari13
3

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

Answered by BrainlyProgrammer
1

Answer:

Question: To print all the odd factors of a number

Code:

CLS

INPUT N

FOR I=1 TO N

IF (N MOD I =0) AND (I MOD 2 <>0)

PRINT I+" "

NEXT I

END

Similar questions