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);
- System.out.println("\t Beri Bintang Pada Kelipatan 5 \n");
- System.out.print("Masukkan Batas Nilai : ");
- int nilai = userInput.nextInt();
- for(int i = 1; i <= nilai; i++){
- if(i % 5 == 0){
- System.out.print("* ");
- }else{
- System.out.print(i + " ");
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement