Thursday 13 March 2014

Looping Structure

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

Chapter : 1 - First code in Node JS Previously I have written a blog about Getting Started with Node JS and its installation. Now lets s...