JAVA output 99 multiplication table
Introduction: JAVA output 99 multiplication table
Two loops can be solved
public static void main ( String[] args ) {
//99 multiplication table
int n;
for ( int a = 1 ; a <= 9 ; a++) {
for ( int b = 1 ; b <= a; b++) {
n = a * b;
System.out.printf ( "%d*%d=%2d " , a, b, n);
}
System.out.println ();
}
}
Copyright statement: The content of this article is contributed by Alibaba Cloud's real-name registered users. The copyright belongs to the original author. The Alibaba Cloud developer community does not own the copyright and does not assume the corresponding legal responsibility. For specific rules, please refer to the " Alibaba Cloud Developer Community User Service Agreement " and " Alibaba Cloud Developer Community Intellectual Property Protection Guidelines ". If you find any content suspected of plagiarism in this community, fill out the infringement complaint form to report it. Once verified, this community will delete the allegedly infringing content immediately.
Two loops can be solved
public static void main ( String[] args ) {
//99 multiplication table
int n;
for ( int a = 1 ; a <= 9 ; a++) {
for ( int b = 1 ; b <= a; b++) {
n = a * b;
System.out.printf ( "%d*%d=%2d " , a, b, n);
}
System.out.println ();
}
}
Copyright statement: The content of this article is contributed by Alibaba Cloud's real-name registered users. The copyright belongs to the original author. The Alibaba Cloud developer community does not own the copyright and does not assume the corresponding legal responsibility. For specific rules, please refer to the " Alibaba Cloud Developer Community User Service Agreement " and " Alibaba Cloud Developer Community Intellectual Property Protection Guidelines ". If you find any content suspected of plagiarism in this community, fill out the infringement complaint form to report it. Once verified, this community will delete the allegedly infringing content immediately.
Related Articles
-
A detailed explanation of Hadoop core architecture HDFS
Knowledge Base Team
-
What Does IOT Mean
Knowledge Base Team
-
6 Optional Technologies for Data Storage
Knowledge Base Team
-
What Is Blockchain Technology
Knowledge Base Team
Explore More Special Offers
-
Short Message Service(SMS) & Mail Service
50,000 email package starts as low as USD 1.99, 120 short messages start at only USD 1.00