Advertisement
thotfrnk

methods3.java

Dec 7th, 2022
47
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.54 KB | None | 0 0
  1. import java.util.Scanner;
  2. public class number3 {
  3.     public static void main(String[] args) {
  4.  
  5.         Scanner input = new Scanner (System.in);
  6.  
  7.         int num;
  8.  
  9.         System.out.println("Please enter a number: ");
  10.         num = input.nextInt();
  11.  
  12.         multiple(num);
  13.     }
  14.  
  15.     public static void multiple(int num) {
  16.         //int multiple;
  17.  
  18.         if(num % 5 == 0) {
  19.             System.out.println("It is a multiple of 5.");
  20.         }
  21.         else
  22.             System.out.println("It is not a multiple of 5.");
  23.  
  24.     }
  25. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement