I am using
For loop and
If within it. For example:
For[a=0, a < 21, a = a + 1, If[EvenQ[a], Print[a,"\n"]] ]
Certainly, the program will print all even numbers below 21 starting from 0.
I would like to
1. 0 2. 2 3. 4
I will be glad if you suggest me some command for the same.