Home  >  Article  >  Java  >  How to use a for loop to output 99 multiplication tables in java

How to use a for loop to output 99 multiplication tables in java

WBOY
WBOYforward
2023-06-03 15:12:052441browse

The code is as follows:

public static void main(String[] args) {
		for(int i=1,j=1;i<=9;j++){
            System.out.print(j+"*"+i+"="+i*j+"\t");
            if (j==i){
                i++;
                j=0;
                System.out.println();
            }
        }
	}

The above is the detailed content of How to use a for loop to output 99 multiplication tables in java. For more information, please follow other related articles on the PHP Chinese website!

Statement:
This article is reproduced at:yisu.com. If there is any infringement, please contact admin@php.cn delete