Jan 13, 2018 @ 13:25

Display number patterns using java

  Here is a list of number patterns that you can produce using any programming language. I use Java in this post. I hope you will find these simple programs useful for programming challenges or assignments you might encounter. You can check also other pattern by clicking here. Here is the first pattern including the full code. I didn’t include the Scanner class for user input because I wanted to […]

Read More >>

Jan 9, 2018 @ 11:56

How to Create a Checkerboard pattern Using Asterisks in Java

Checkerboard Pattern in Java

Here is a simple program to draw a checkerboard pattern in Java. There can be a different way of doing it. In this case, the program pads every other row with a space to have a zigzag effect. To do that the program checks if the row number is even and if it is, it prints spaces at the beginning of the row. It uses the modulus operator (%) and […]

Read More >>

Jan 8, 2018 @ 20:38

How to Create a Hollow Rectangle Using Asterisks in Java

A hollow rectangle such as the box shown below can be drawn by printing the star symbol on only the first and the last row, and the first and the last column. We can fill the rest of the spaces, i.e. from row two up to the (last row – 1) and from column two up to the (last column – 1) with spaces to produce the hollow rectangle. Given […]

Read More >>

Sep 17, 2017 @ 18:18

Java Program to show Maximum and Minimum

This Java program prints the maximum and the minimum number of a given numerical digit. For example – typical output would be Please enter a number 42308 and theoutput is –  minimum digit is 0 and the maximum digit is 8   /** Method that shows the minimum and maximum digit *of any given number **/ import java.util.*; public class MaxMin { static void maxMin(int number){ int digit = 0; […]

Read More >>