Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started