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(); } }