Search found 5 matches

by Drazen
Tue Sep 21, 2010 2:26 pm
Forum: QBASIC and QB64 Questions & Answers
Topic: Qbasic program(need help)
Replies: 10
Views: 17418

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 #...
by Drazen
Tue Sep 21, 2010 9:27 am
Forum: QBASIC and QB64 Questions & Answers
Topic: Qbasic program(need help)
Replies: 10
Views: 17418

Re: sorry

commandvom wrote:sorry, i confuse means of odd-even!
I google translated and it said odd & even, but I will try to help you understand :

ODD are numbers like : 1,3,5,7,9,11...

EVEN are numbers like : 2,4,6,8,10,12...
by Drazen
Tue Sep 21, 2010 4:38 am
Forum: QBASIC and QB64 Questions & Answers
Topic: Qbasic program(need help)
Replies: 10
Views: 17418

Re: prg

dim odd(20) as integer, even(20) as integer, i as integer, aux as integer dim totalodd as integer, totaleven as integer, k as integer, j as integer randomize timer j=1 k=1 for i=1 to 20 aux=10 + INT(RND * 89) if (aux mod 2)=0 then odd(k)=aux totalodd=totalodd+aux k=k+1 else even(j)=aux totaleven=to...
by Drazen
Mon Sep 20, 2010 4:15 pm
Forum: QBASIC and QB64 Questions & Answers
Topic: Qbasic program(need help)
Replies: 10
Views: 17418

CLS FOR i = 1 TO 10 RANDOMIZE TIMER a(i) = 10 + INT(RND * 89) PRINT a(i) Next i FOR i = 1 TO 10 IF a(i) MOD 2=0 THEN PRINT a(i); "broj je paran" p(i) = a(i) ELSE PRINT a(i); "je neparan" n(i) = a(i) END IF NEXT i OPEN "vjezba.dat" FOR OUTPUT AS #1 FOR i = 1 TO 10 WRITE ...
by Drazen
Mon Sep 20, 2010 1:46 pm
Forum: QBASIC and QB64 Questions & Answers
Topic: Qbasic program(need help)
Replies: 10
Views: 17418

Qbasic program(need help)

Hi all! I need to make this program and I don't know how,can you do it and explain please,I know for someone will seem siple but I'm begginer... - Generate 20 random numbers(from 10-99) - show odd and even numbers - recommit odd and recommit even numbers - show sum of odd and even number - show then...