Advertisement
ตัวอย่างโค้ดโปรแกรมคำนวณสูตรคูณ ที่ใช้ภาษาจาวา ในการพัฒนา ดังโค้ดด้านล่าง..
Advertisement
/*
 * Code by DekDEV.com
 */
import java.util.Scanner;
public class Multiplication {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		System.out.print("Enter number : ");
		int number = sc.nextInt();
		
		for (int i = 1; i <= 12; i++) {
			System.out.println(number + " x " + i + " = " + number * i);
		}
	}
}

Advertisement