loops - Limiting max character output in Java? -


i having trouble formatting output of loop have 15 characters per line. can please help?

public class ascii {  public static void main(string[] args) {      (int ascii = 43; ascii <= 120; ascii++) {         system.out.print((char)ascii + "  ");     }  } 

}

this accomplish that:

for (int ascii = 43, = 1; ascii <= 120; ascii++) {      system.out.print((char)ascii + "  ");       if (i++ % 15 == 0)      {           system.out.println();      } } 

Popular posts from this blog

php - How should I create my API for mobile applications (Needs Authentication) -

5 Reasons to Blog Anonymously (and 5 Reasons Not To)

Google AdWords and AdSense - A Dynamic Small Business Marketing Duo