@soche123, your attitude stinks. We don't care if you NEED this badly. You have failed to do anything to help yourself. Guess what, if you're planning a career in programming being able to think for yourself is an absolute must.
You clearly do not understand the elements of simple logic and for loops. That in itself isn't a problem. It's tricky for first timers. What I suggested was to draw a flow chart to help you understand it, visualise it.
That should be your next step, specifically look at the flow chart for a nested for loop.