Consider the following two code segments. In both, assume that n is an integer variable that has been declared and initialized. Segment 1 int prod = 1; int i; for (i = 2; i < = n; i++) { prod * = i; } System. out. println (prod); Segment 2 int prod = 1; int i = 2; while (i < = n) { prod * = i; i++; } System. out. println (prod); For which integer values of n do these code segments print the same result?
+3
Answers (1)
Know the Answer?
Not Sure About the Answer?
Get an answer to your question ✅ “Consider the following two code segments. In both, assume that n is an integer variable that has been declared and initialized. Segment 1 ...” in 📙 Computers & Technology if there is no answer or all answers are wrong, use a search bar and try to find the answer among similar questions.
Home » Computers & Technology » Consider the following two code segments. In both, assume that n is an integer variable that has been declared and initialized. Segment 1 int prod = 1; int i; for (i = 2; i < = n; i++) { prod * = i; } System. out.