Answer the question
In order to leave comments, you need to log in
Can you tell how this piece of code works?
public class Main
{
public static void main(String[] args)
{
int i, N = 20;
for (i = 0; -i < N; i--) {
System.out.print("*");
}
}
}
Answer the question
In order to leave comments, you need to log in
Minus minus twenty (-(-20)) equals twenty. Well, twenty is not less than twenty.
Just replace System.out.print("*"); to System.out.print(-i); and everything will become clear to you.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question