Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /**MUST System.out.println to define constants at the start or scumbag lecturer marks me down
- package switchcase;
- import java.util.Scanner;
- /**
- *
- * @author pclab
- */
- public class q4 {
- public static void main(String[] args){
- Scanner keyboard=new Scanner(System.in);
- int no1,no2,result;
- System.out.println("Please enter first number");
- no1=keyboard.nextInt();
- System.out.println("Please enter second number");
- no2=keyboard.nextInt();
- if (no1>no2)
- result=no1%no2;
- else if (no2>no1)
- result=no2%no1;
- else
- result=0;
- if (result==0)
- System.out.println("the 2 numbers are divisible");
- else
- System.out.println("the 2 numbers are divisible");
- }
- }
Add Comment
Please, Sign In to add comment