Question: Consider the following code segment. int a = 24; int b = 30; while (b != 0) { int r = a % b; a

Consider the following code segment.

int a = 24; int b = 30; while (b != 0) { int r = a % b; a = b; b = r; }

System.out.println (a);

What is printed as a result of executing the code segment?

Question 14 options:

A)

30

B)

24

C)

6

D)

0

E)

12

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!