>ok i got the loop i just dont understand it
Translation: I ganked this code, but I need to know how it works to get credit for my homework.
>can some one explain it quick
What don't you understand? It's a simple loop that counts p times and continually updates the result by multiplying n into it.
>You might, for the sake of clarity, want to chage
>result *= n; to result = result * n;
Why? It's not like this is a huge stumbling point for beginners.
No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.