public class JavaApplication1 {
public static void main(String[] args) {
for (int i = 5 < = 100; 1 + = 5){
System.out.print(i);
if (i <100){
System.out.print(",");
}
}
}
}
daryl_1201 0 Newbie Poster
Recommended Answers
Jump to Post"It's not working" is completely useless. Describe how it's not working if you want better help. But I'll point out some obvious flaws in the code:
for (int i = 5 < = 100; 1 + = 5){
This line is all borked up. A for loop …
Jump to PostReverse the loop to count down from 100:
for (int i = 100; i >= 5; i -= 5) { System.out.print(i); if (i > 5) { System.out.print(","); } }
All 5 Replies
deceptikon 1,790 Code Sniper Team Colleague Featured Poster
adikimicky 0 Light Poster
joshfizzle commented: I like this clear and concise explanation. +0
daryl_1201 0 Newbie Poster
deceptikon 1,790 Code Sniper Team Colleague Featured Poster
stultuske 1,116 Posting Maven Featured Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.