Multiple Choice
What does the following code snippet print?
Int a = 120;
Int b = 90;
Int n1 = Math.abs(a) ;
Int n2 = Math.abs(b) ;
Int result = 1;
For (int k = 1; k <= n1 && k <= n2; k++)
{
If (n1 % k == 0 && n2 % k == 0)
{
Result = k;
}
}
System.out.println(result) ;
A) 10
B) 20
C) 30
D) 40
Correct Answer:

Verified
Correct Answer:
Verified
Related Questions
Q23: How many times is the text "Let's
Q24: What is the output of the code
Q25: What is the output of the code
Q26: How many times does the following loop
Q27: Suppose that the chance to hit the
Q29: What will be printed by the statements
Q30: What is the last output line of
Q31: Which of the following loop(s) could possibly
Q32: What is the output of the following
Q33: What is the output of this code