+ 1
How can one print prime numbers between 1 and 100 in Java using do while loop
Do while
2 Respuestas
+ 2
-----------------
algorithm:
----------------
1. make a method that receives a number and returns true if it is prime, false otherwise;
2. create a do while loop that loops from 1 to 100;
3. use the method created in (1) to check in every iteration if the number is prime, if so print it;
+ 1
https://code.sololearn.com/c6yz0DMw8euz/#cpp
An algorithm for checking if the number is prime.
Hope this helps.