Ferix

RSOJava#5

Nov 25th, 2020
564
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.71 KB | None | 0 0
  1. import java.util.Scanner;
  2.  
  3. public class MyClass {
  4.     public static void main(String args[]) {
  5.        
  6.         Scanner input = new Scanner(System.in);
  7.        
  8.         int input1 = input.nextInt();
  9.         int input2 = input.nextInt();
  10.         int input3 = input.nextInt();
  11.        
  12.         if(input1 % input2 == 0){
  13.             System.out.println(input1 + " is divisible by " + input2);
  14.         }else{
  15.             System.out.println(input1 + " is not divisible by " + input2);
  16.         }
  17.         if(input1 % input3 == 0){
  18.             System.out.println(input1 + " is divisible by " + input3);
  19.         }else{
  20.             System.out.println(input1 + " is not divisible by " + input3);
  21.         }
  22.    
  23.     }
  24. }
Advertisement
Add Comment
Please, Sign In to add comment