Computer Applications
Predict the output and the number of times the loop runs:
class Test {
public static void main(String args[]) {
int i;
for(i=0;i<5;i++)
System.out.println(i-i*i);
}
}
Predict the output and the number of times the loop runs:
class Test {
public static void main(String args[]) {
int i;
for(i=0;i<5;i++)
System.out.println(i-i*i);
}
}