+ 1
What is the output for the code?
4 Answers
+ 10
I have no idea about why do you want to print all the integers below 10, though it's syntax is wrong. A for loop works with three conditions (initialization; termination; increment/decrement)
In your code, you've put the decrement at the "termination", and termination wants a boolean condition (thus it gives an error). Instead, put it at the "decrement":
for(int i=10;;i--)
{
System.out.println(i);
}
+ 2
it requires terminatio as mentioned abov
+ 1
even I got a doubt will that syntax works?
0
the syntax is not work .I am post this if anyone notice that or not