java - nested for loop prime checker -


Here's my code. I'm new to programmers in any way, and a user input value, Each

  import java.util.Scanner; Import java.math. *; Public class Sforprime {public static zero main (string [] args) {double box = 0; Double boxxx = 0; Int po = 0; Int blub = 0; Int no = 1; Scanner scan = new scanner (System.in); System.out.println ("Infolution Number"); Box = scan. NXIT (); Boxxx = Math.0 square (box); (For int bowlman = (int) box; batman> = 0; batman -) {if (no == 1) {no = 0; } And if (po == 0) {System.out.println (blub); Po = 0; } Blub = batman; (Int dot = (int) box box; Mot-gt; = 2; Mot -) {if (po == 1) {} else if (box% mot == 0) {po ++; }} If (po == 0) {System.out.println (blub); }}}}   

What is happening is nothing after this input of your number does what is going wrong with me?

Since you have initial int int = (int) boxxx box% mot and 0 is always increased from 1 And so it never gets printed. Initial speed = Box -1, but you are advised to use the above program because it is cleaner

Comments

Popular posts from this blog

php - PDO bindParam() fatal error -

logging - How can I log both the Request.InputStream and Response.OutputStream traffic in my ASP.NET MVC3 Application for specific Actions? -

java - Why my included JSP file won't get processed correctly? -