Armstrong number in Java using for loop

It is a very good exercise to improve our logic and we wish to solve some problems. And so in this post we try to give example on how to solve this problem, determining Armstrong number in Java using for loop.

Java print even numbers while loop

We try to solve specific logical problems in Java using some form of loops. In this post we present an example on how to print even numbers using while loop in Java

Simple Loop - Display All Numbers From 1 To 100

Below is a very simple example that shows how to use simple loop. We will display all numbers from 1 to 100 in Java.

Java Nested Loop Sample Problem 4

The fourth problem we wish to give is again an enhancement of the first problem in this series that also draws a triangle. This time, we wish to draw an inverted triangle as shown below for input number 5:

*****
****
***
**
*

Java Nested Loop Sample Problem 3

We continue our series in nested loop logic problems and we improve on the first problem we stated. We are now reversing the pattern of the triangle, and instead of showing this pattern for input 3:

*
**
***
We will show this:
  *
 **
***

Java Nested Loop Sample Problem 2

For the series of drawing triangles using nested loop, we present our second problem that enhances the first problem in this post. This also accepts a number and draws a triangle pattern accordingly. Below is what should be shown when the number input is 5:

1
23
456
7890
12345

Java Nested Loop Sample Problem 1

For those who wish to improve their logical programming skills, we will be showing simple problems that can be solved using nested loops. Below is our first problem, where given a number will show a pattern. For example, if we are given the number 5, the output of our code should be:

*
**
***
****
*****