Ask Question
28 March, 22:10

Int i = 1, mult3 = 3;

while (mult3 < 20)

System. out. print (mult3 + " ");

i++;

mult3 * = i;

+3
Answers (1)
  1. 28 March, 22:49
    0
    3 6 18

    Explanation:

    Code segment:

    int i = 1, mult3 = 3;

    while (mult3 < 20) {

    / / We assume the body of the while loop to be enclosed in {}

    / / Otherwise the code will print 3 in an infinite loop

    System. out. print (mult3 + " ");

    i++;

    mult3 * = i;

    }

    Let us iterate through the while loop:

    i=1, mult3 = 3

    i=2, mult3 = 6

    i=3, mult3 = 18

    i=4, mult3 = 72 (The while loop terminates)

    So the code will print out the following result:

    3 6 18
Know the Answer?
Not Sure About the Answer?
Get an answer to your question ✅ “Int i = 1, mult3 = 3; while (mult3 < 20) System. out. print (mult3 + " "); i++; mult3 * = i; ...” 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.
Search for Other Answers