mercredi 22 janvier 2020

Program for this number pattern using for loop in java 1 22 3 4444 5 666666 7 88888888. Not getting the desired pattern

public static void main(String[] args) {
   int noOfRows = 8;

    printPattern(noOfRows);
}

private static void printPattern(int num){
    for(int i = 1; i <= num; i++){
        for(int j = 1; j<=i;j++){
            System.out.print(i);
        }            
        System.out.println();            
    }        

Program for this number pattern using for loop in java 1 22 3 4444 5 666666 7 88888888. Not getting the desired pattern

Aucun commentaire:

Enregistrer un commentaire