Question: Consider the following program for optimization: 1. program Ex1 2. t=0 3. n =5 4. for i = 1 to 6 5. t = 100
Consider the following program for optimization: 1. program Ex1 2. t=0 3. n =5 4. for i = 1 to 6 5. t = 100 + (100/2) - 50 6. n = n + 1 7. if n = 3 then 8. n = (t + n) * 32 9. end if 10. next 11. end What are the optimization techniques which can be used on the program? Identify the lines in the above program that can be optimized along with the optimization technique and write the optimized code.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
