Looking for reliable answers? Westonci.ca is the ultimate Q&A platform where experts share their knowledge on various topics. Get immediate answers to your questions from a wide network of experienced professionals on our Q&A platform. Discover detailed answers to your questions from a wide network of experts on our comprehensive Q&A platform.

JAVA

plzzz help...........​


JAVAplzzz Help class=

Sagot :

tonb

Answer:

import java.util.Scanner;

class Main {

 public static void main(String[] args) {

   Scanner scan = new Scanner(System.in);

   while(true) {

     System.out.print("Enter an integer (0 to exit): ");

     int num = scan.nextInt();

     if (num == 0) break;

     if (num%3 == 0 && num%5 == 0) {

       System.out.printf("%d is divisable by both 3 and 5.\n", num);

     }

     else if (num%3 == 0 && num%5 != 0) {

       System.out.printf("%d is divisable by 3 but not by 5.\n", num);

     }

     else if (num%3 != 0 && num%5 == 0) {

       System.out.printf("%d is divisable by 5 but not by 3.\n", num);

     } else {

       System.out.printf("%d is not divisable by 3 or 5.\n", num);

     }

   }

   scan.close();

 }

}