خرید بک لینک

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 ago

(Why?)

برچسب: 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, نویسنده: استخدام کار تاريخ: يکشنبه 24 مرداد 1395 ساعت: 20:31

صفحه بندی