Computer Science, asked by sunitazirange, 1 year ago

write a java program to print all prime numbers between 1 and 100(1 and 100 are also included)

Answers

Answered by Iamavai
2

write a java program to print all prime numbers between 1 and 100(1 and 100 are also included)

Answer:

The number which is only divisible by itself and 1 is known as prime number. For example 2, 3, 5, 7…are prime numbers. Here we will see two programs: 1) First program will print the prime numbers between 1 and 100 2) Second program takes the value of n (entered by user) and prints the prime numbers between 1 and n. If you are looking for a program that checks whether the entered number is prime or not then see: Java Program to check prime number.

Similar questions