Last Updated: 13 August, 2022
On this tutorial page we are going to learn how to write a Java program to print first 100 prime number.
A prime is a natural number that is greater than 1 and divided by 1 or itself only. If any number is divisible by any other number, then that number is not a prime number.
Prime Numbers: 2, 3, 5, 7, 11, 13, 17, 19, 23 ...
Let's see the Java program implementation.
Output
First 100 prime numbers are:
2 3 5 7 11 13 17 19 23 29 31 37 41 43 47 53 59 61 67 71 73 79 83 89 97 101 103 107 109 113 127 131 137 139 149 151 157 163 167 173 179 181 191 193 197 199 211 223 227 229 233 239 241 251 257 263 269 271 277 281 283 293 307 311 313 317 331 337 347 349 353 359 367 373 379 383 389 397 401 409 419 421 431 433 439 443 449 457 461 463 467 479 487 491 499 503 509 521 523 541
Output
Odd Numbers from 1 to 100 are:
1 3 5 7 9 11 13 15 17 19 21 23 25 27 29 31 33 35 37 39 41 43 45 47 49 51 53 55 57 59 61 63 65 67 69 71 73 75 77 79 81 83 85 87 89 91 93 95 97 99
That's all guys, hope this Java Program is helpful for you.
Happy Learning... 😀
feedback@javabytechie.com