Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Show the output of the following program: public class StrangeClass { public sta

ID: 3616985 • Letter: S

Question

Show the output of the following program:

public class StrangeClass

{

     public static void main(String[]args)

   {

          int num=0;

          while(num <= 29)

          {

             if (strange(num))

                  System.out.println("True");

             else

                   System.out.println("False");

            num = num + 4;

          }

   }

public static boolean strange(int n)

   {

          if (n % 2== 0 && n % 3 == 0)

             return true;

          else

             return false;

   }

}

Explanation / Answer

please rate - thanks num=0 is num
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote