logo

Crowdly

Trace the following code, what is the output? boolean flag = false; int a[] ...

✅ The verified answer to this question is available below. Our community-reviewed solutions help you understand the material better.

Trace the following code, what is the output?

boolean flag = false;

int a[] = new int[10];

int i = 1;

while(!flag) {

       a[i] += i;

       if (i >= a.length){

           flag = true;

        }

        System.out.println(a[i]);

       i++;

}

0%
0%
0%
More questions like this

Want instant access to all verified answers on moodle.polytechnic.bh?

Get Unlimited Answers To Exam Questions - Install Crowdly Extension Now!