by CodeChum Admin
Numbers in threes are awesome! But the one last time was too lengthy to look at, so I just want to view it in a shorter but still readable format.
You okay with this task?
Instructions:
Output
A line containing integers divisible by 3 separated by a space.
3·6·9·12·15·18·21·24...
public class Program {
public static void main(String[] args) {
for(int i=0; i<100;i++) {
if(i%3==0){
System.out.print(i+" ");
}
}
}
}
Comments
Leave a comment