i am to determine whether in a pair of integers if the secondnumber is a multipl
ID: 3618336 • Letter: I
Question
i am to determine whether in a pair of integers if the secondnumber is a multiple of the first if so return true other wisefalse. i am getting errors when i run it.import java.util.Scanner;
Scanner input = new Scanner (System.in);
System.out.println ('enter a number);
int num= input.nextInt();
System.out.println ("enter a number);
int num1= input.nextInt();
int i= 12;
int j= 2;
int ans= mod (i,j);
}
public static int mod (int num, int num1)
{
int result;
if (num % num1==0)
result= true;
else
result= false;
}
Explanation / Answer
shouldn't there be quotes around both sides of "enter a number" ?
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.