BAsic,,, need help

guys, how i can make a program that gives the even numbers that i inputed...
example:i input 10 then it outputs 2,4,6,8 something like that....

im just a beginner and dont know much of codes.. i know very little.. please help me.









To check if a number is even or odd, use the modulo (%) operator. This will give you the remainder of a division equation. (i.e. 15 % 7 = 1).

For odd numbers:
 
number % 2 != 0


For even numbers:
 
number % 2 == 0


I think you can figure out the rest :)
You need a loop that starts with 2.

Loop as long as the index is less then the value in question.

Increase the index by 2 each cycle.
Topic archived. No new replies allowed.