QBASIC program to input any multi digit number and display the sum of odd digits and even digits present in it .
Answers
Answered by
1
Answer:
cls
input"Enter first number";A
input"Enter Second number";B
c=A+B
print"The sum is";c
End
Explanation:
you will understand . no need of explanation.
Answered by
2
Answer:
DECLARE SUB SUMODD (N)
CLS
INPUT "ENTER ANY NUMBER"; N
CALL SUMODD (N)
END SUB SUMODD (N)
S = 0
WHILE N < > 0
R = N MOD 10
IF R MOD 2 = 1 THEN S = S + R
N = N \ 10
WEND
PRINT "SUM OF ODD DIGITS"; S
END SUB
Explanation:
Similar questions