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
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
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
Math,
2 months ago
Computer Science,
2 months ago
Computer Science,
2 months ago
Science,
5 months ago
History,
5 months ago
English,
10 months ago
History,
10 months ago