What is the difference between
For(;;)
{
If()
{}
Else
{}
}
And
For(;I;){
}
What is the difference between
For(;;)
{
If()
{}
Else
{}
}
And
For(;I;){
}
What is the Q exactly? Both are infinite loop which would do nothing
First one is an infinite loop unless you use break
somewhere inside and second one runs till value of I!=0
.
(in second case value of I
can be negative value too, and it will be treated as true and loop continues to run)
As long as ‘I’ doesn’t change (to zero/false) inside the loop, there’s no difference.
Both are infinite loops.