Let’s print some patterns (using loops)

You can use loops, specially "for" loop to print out different patterns. You will see below how to print something in a row and go to next row when the loop is over. Also how to print a space when you need and looping inside a loop to count the number of rows you need... Continue Reading →

Advertisements

How to print 1 – 100 in Java

There are many ways to print 1-100. The easiest way is to use a loop. In that case you have 3 types of loops to use. Method-1 Method - 2 Method-3 Method-4 (Using Recursion) And there are a lot more ways to print these numbers. Thank you.

Using loops in Java

You can use loops to re-run a particular code segment until it satisfy a certain condition. Basically there are 3 basic types of loops in Java. While loop For loop Do-While loop While Loop Syntax : while(){   } For example : x++ => increment the value of x by one The printing statement will... Continue Reading →

Blog at WordPress.com.

Up ↑