EmbLogic's Blog

C: JATINDER KUMAR

Which code will run faster

for(i=0;i<100;i++)
for(j=0;j<10;j++)
a[i][j]=0;

OR

for(j=0;j<10;j++)
for(i=0;i<100;i++)
a[i][j]=0;

2 Responses to C: JATINDER KUMAR

  1. john McArthur says:

    second one

  2. How come?? mean on what basis your answer is?
    Is there any change when complier optimize the both?? i even see the assmebly code of both and both are same . So on what basis i can say which one is faster

Leave a Reply to john McArthur Cancel 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>