What will be the output of the following Java program?

class Quizall

{
             public static void main(String args[])
        {
                int a[] = {1, 2, 3, 4, 5};
                for ( int i = 0; i < a.length - 2; ++i)
                System.out.println(a[i] + " ");
        } 
}

1
1 2 3 4 5
2
1 2 3 4
3
1 2
4
1 2 3

Sponsored

hivanix.in

Visit

This quiz is brought to you by hivanix.in

🌐 Web App Development

Quick Navigation