go to previous page   go to home page   go to next page hear noise

Answer:

Yes. (Actually, a good answer would be "sounds dangerous", because it is.)


Omitting the Test

When the test part of a for is omitted it is as if the value true were put in its place. So,

for ( initialize ;   ; change )
  loopBody ;

is the same as:

for ( initialize ;  true  ; change )
  loopBody ;

This is done for compatibility with the language C. It should not be used in newly written programs.


QUESTION 14:

Could all three parts be omitted from a for?