Showing posts with label While Loop. Show all posts
Showing posts with label While Loop. Show all posts

Tuesday, November 10, 2020

While Loop Print Prime Numbers In Java

1. Overview


In this article, You'll learn how to use a while loop to print prime numbers in java. This is a very basic programming interview question for the freshers. First, we'll talk about what is prime number?.

A prime number (or a prime) is a natural number greater than 1 that cannot be formed by multiplying two smaller natural numbers. 

Note:

A natural number greater than 1 that is not prime is called a composite number.