Question: Whats Wrong with my program. import java.util.Scanner; / / Import the scanner class Public class Multiples { / / assumes that n is a postive
Whats Wrong with my program.
import java.util.Scanner; Import the scanner class
Public class Multiples
assumes that n is a postive integer
public static boolean isMultipleofint nint n
ifnn
return true;
else
return false;
Driver Code
public static void mainString args
Scanner inputnew ScannerSystemin;
int n;
int n;
accept inputs from user
System.out.printlnEnter first";
ninput.nextInt;
System.out.printlnEnter second number";
ninput.nextInt;
if isMultipleofnn true
System.out.printfnis a multiple of n;
else
System.out.printfn is not a multiple of n;
input.close;
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
