Vote count: 0 On my theory this code should print a triangle of stars, in this case 5 lines each line will have 1 more star than the line before it, but in reality it prints 5 lines on 1 stars why ? public class Main { private static void printStars(int amount){ System.out.print("*"); } private static void printTriangle(int size){ int i = 0; int b = 0; while (size > i){ printStars(b); System.out.println(""); b++; i++; } } public static void main(String[] args) { printTriangle(5); }} asked 29 secs agoReg1 Let's block ads! بخوانید...
ادامه مطلب