jawaban no 1

 avatar
unknown
java
a year ago
628 B
12
Indexable
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);

        // Meminta pengguna untuk memasukkan bilangan bulat positif
        System.out.print("Masukkan bilangan bulat positif: ");
        int number = scanner.nextInt();

        for (int i = 1; i <= number; i++) {
          if(i%2==0){
          int bagi = number/i;
          int sisa = number%i;
          if(i<10){
              System.out.println(number + " : " + i + " = " + bagi +" sisa "+ sisa);
          }
          }
           
        }

        scanner.close();
    }
}
Editor is loading...
Leave a Comment