burger2227 wrote:NEED 20 numbers in array if ALL ODD or ALL EVEN. Could happen.

number = INT(RND * 90) + 10 'INT never returns 90, only 89 most = 90 * .9999999

'other code OK

Works OK, what else you need? NOT 0?

FOR i = 1 TO 20

IF odd(i) <> 0 THEN WRITE #1, odd(i)

IF even(i) <> 0 THEN WRITE #1, even(i)

NEXT

CLOSE #1

What else? Hello Croatia!

What else?

else is that now I have all zeros(0) in my result, here's the code :

CLS

DIM a(20)

FOR i = 1 TO 20

RANDOMIZE TIMER

a(i) = INT(RND * 90)+10

PRINT a(i)

Next i

OPEN "vjezba.dat" FOR OUTPUT AS #1

FOR i= 1 to 20

IF p <> 0 THEN WRITE #1, p

IF n <> 0 THEN WRITE #1, n

NEXT i

CLOSE #1

FOR i = 1 TO 20

IF a(i) MOD 2=0 THEN

PRINT a(i); "broj je paran"

ELSE

PRINT a(i); "je neparan"

END IF

NEXT i

OPEN "vjezba.dat" FOR OUTPUT AS #1

FOR i = 1 TO 20

WRITE #1, p, n

NEXT i

CLOSE #1

PRINT

PRINT "brojevi"

PRINT "parni:", "neparni:"

OPEN "vjezba.dat" FOR INPUT AS #1

DO UNTIL EOF(1)

INPUT #1, p, n

PRINT p, n

LOOP

CLOSE #1

END