Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.Scanner;
- public class Lab4a
- {
- public static void main(String[] args)
- {
- Scanner hue = new Scanner(System.in);
- System.out.print("Masukkan angka: ");
- int nilai = hue.nextInt();
- System.out.print("Faktor bilangannya: ");
- int tambah = 0;
- for (int i = 0; i <= nilai; i++)
- {
- tambah++;
- if (nilai % tambah == 0)
- {
- System.out.print(tambah + " ");
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement