السؤال الثاني يبغاله تفكير شوي عشان أحله ،، فراح أحله آخر واحد
السؤال الثالث:
اكتب ميثود تقوم باستقبال رقمين من الـmain وترجع (true) إذا كان الرقم الأول يقبل القسمة على الرقم الثاني بدون باقي، أما إذا كان لا يقبل فترجع (false)
الكود:
كود PHP:
package q3;
import java.util.*;
public class Q3 {
public static Boolean multiple(int i1,int i2){
Boolean x=(i1%i2==0);
return x;}
public static void main(String[] args) {
Scanner input=new Scanner(System.in);
System.out.println("Enter the first number: ");
int num1=input.nextInt();
System.out.println("Enter the second number: ");
int num2=input.nextInt();
System.out.println(multiple(num1,num2));
}
}