Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package com.tutorial;
- import java.util.Scanner;
- public class Main {
- public static void main(String[] args) {
- Scanner userInput = new Scanner(System.in);
- int angka;
- System.out.println("\t Habis Dibagi 3 & 5 \n");
- System.out.print("\n Masukkan Batas Nilai : ");
- angka = userInput.nextInt();
- System.out.print("\n Bilangannya : ");
- for (int i = 1; i <= angka; i++) {
- if (i % 3 == 0 && i % 5 == 0) {
- System.out.print(i + " ");
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement