Input any
20 number and find their sum,
largest
and smallest number in qbasic
Answers
Answered by
1
Answer:
CLS
even_sum$=0
odd_sum$=0
FOR I = 0 TO 20
INPUT "read N numbers..", n(I)
NEXT I
FOR J = 1 TO 20
IF n(j)<0
THEN IF (-1)*n(j)%2==1
THEN odd_sum=odd_sum+n(j)
ELSE
IF n(j)%2=0
THEN even_sum=even_sum+n(j)
NEXT J
PRINT "EVEN POSITIVE NUMBERS SUM";even_sum
PRINT "ODD NEGATIVE NUMBERS SUM";even_sum
Similar questions