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

What is the output of the following: int myNum = 10; int yourNum = 31; if (yourN

ID: 3762557 • Letter: W

Question

What is the output of the following:

int myNum = 10;
int yourNum = 31;

if (yourNum % myNum == 3)
{
   yourNum = 3;
   myNum = 1;
}
else if (yourNum % myNum == 2)
{
   yourNum = 2;
   myNum = 2;
}
else
{
   yourNum = 1;
   myNum = 3;
}
System.out.println("myNum = " + myNum + " - " + "yourNum = " + yourNum);

need one more statement for: else if (yourNum % myNum == 0)

yourNum = 3;
myNum = 1;

yourNum = 2;
myNum = 2;

yourNum = 1;
myNum = 3;

A.

need one more statement for: else if (yourNum % myNum == 0)

B.

yourNum = 3;
myNum = 1;

C.

yourNum = 2;
myNum = 2;

D.

yourNum = 1;
myNum = 3;

Explanation / Answer

yourNum = 1;
myNum = 3;

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