adplus-dvertising
frame-decoration

Question

What is the output of this program?
    class array_output 
    {
        public static void main(String args[]) 
        {
            int array_variable [] = new int[10];
     for (int i = 0; i < 10; ++i) 
            {
                array_variable[i] = i;
                System.out.print(array_variable[i] + " ");
                i++;
            }
        } 
    }

a.

0 2 4 6 8

b.

1 3 5 7 9

c.

0 1 2 3 4 5 6 7 8 9

d.

1 2 3 4 5 6 7 8 9 10

Posted under Java Programming

Answer: (a).0 2 4 6 8

Engage with the Community - Add Your Comment

Confused About the Answer? Ask for Details Here.

Know the Explanation? Add it Here.

Q. What is the output of this program?