back soft

مطالب مرتبط با «why is this method crude» در back soft | نویسنده: استخدام کار

Why this method doesn't want to be executed more than 1 times per line

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! بخوانید...

ادامه مطلب

برچسب‌های مرتبط

why is this method of determining the concentration of cocl2 | why was this method of describing color invented | why is this method referred to as trial and error | why was this method chosen by the founders | why is this method crude | why does this method work