Question: Explain why a compiler might make the following optimization to a C program. You must be very specific, otherwise you will get ZERO credit. Before

Explain why a compiler might make the following optimization to a C program. You must
be very specific, otherwise you will get ZERO credit.
Before Optimization:
for (j=0; j <20; j++)
for (i=0; i <200; i++)
x[I][j]=x[I][j]+1;
After Optimization:
for (j=0; j <200; i++)
for (j=0; j <20; j++)
x[I][j]=x[I][j]+1;

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!