Sup' guys, today im going to share about Looping And Iteration In C Programming.
Loop is actually Looping, it allows you to iterate something until specified times, and stop at specified point.
to help you understand, see the Loop / Iteration Flowchart below:
in Looping, Basically i use :
-While
-For
-Do-While
i'll explain all of it to you , starting with
While .
for me, Example is the Best teacher. so ill give the example directly to you , jump to Code::Blocks !
*this example is about finding the average glass of water drunk per day in a week.
For.
*same example
Do-While.
*same example
Basically, Do While is a bit similar to While
the difference is in While, you state the loop condition first then give instruction. but in Do-Whle , you do the instruction first , Then state the loop condition
Example:
Hope this Helps
Peace !
Tidak ada komentar:
Posting Komentar