Looping Structure
Looping/Iterative/Repetitive Structures:- They are used to repeat set of statements/block of code.
- Like C/C++ Java also provides:
1.While
2.Do-While
3.For
- Parts Of Looping Structure
-Initialization : Starting value (i=1)
-Condition : Ending value (i<=100)
- Re-initialization : increment/decrement (i++/i--)
Example : For Loop
Program to print the fibonicci series.
PROGRAM:
Fibonicci Series |
OUTPUT:
Output for Fibonicci Series |
No comments:
Post a Comment