EmbLogic's Blog

for loop

what is deference between following two for loop statements

for(y=1;y<10;y++) x=y;

and for(y=1;(x=y)<10;y++);

One Response to for loop

  1. manoj says:

    in the first statement condition is checked first and assignment is done later,,,,, and in the second one… assignment is being done before checking the condition…:)

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>