Quantcast
Channel: Programming Forums
Viewing all articles
Browse latest Browse all 51036

Arithmetic with a for loop

$
0
0
Hello Everyone,
One thing that I was not able to fully understand even though I read through the section on it a few times, is the for loop. I mean, I understand the premise of (statement, condition, update statement). However, I do not quite understand how a math problem is affected by this.

Can someone clarify with a simple example of how this works using multiplication and division? I would really appreciate it!

Oh, and lastly, why would you use a do.. while loop? What is it good for when compared to say, a sentinel loop? Thanks!

Viewing all articles
Browse latest Browse all 51036

Trending Articles