Menu
Question Index
...

Given the same system performance, which of the following for loops execute faster?

X: for(int i = 100000; i > 0; i--)
    {
    }
Y: for(int i = 1; i < 100001; i++)
    {
    }


Y executes faster than X
X executes faster than Y
Both will execute in same time
Can not be predicted

Doubts

Problems

Topic: for Loop In Java

Read this topic
Take test on this topic

0
Wrong
Score more than 2 points

© meritcampus 2019

All Rights Reserved.

Open In App