aspose file tools
The moose likes Java in General and the fly likes problem displaying prime no program. Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Java » Java in General
Reply Bookmark "problem displaying prime no program. " Watch "problem displaying prime no program. " New topic
Author

problem displaying prime no program.

naved momin
Ranch Hand

Joined: Jul 03, 2011
Posts: 675

it is to display prime no from 1 to 10
but the output is 2 , 3 , 5 , 7
which is wrong 2 is not a prime no and 1 is but not getting display


The Only way to learn is ...........do!
Visit my blog http://inaved-momin.blogspot.com/
Jesper de Jong
Java Cowboy
Bartender

Joined: Aug 16, 2005
Posts: 12929
    
    3

naved momin wrote:which is wrong 2 is not a prime no and 1 is but not getting display

You are mistaken. 2 is a prime number, and 1 is not a prime number. See Prime for why this is so.


Java Beginners FAQ - JavaRanch SCJP FAQ - The Java Tutorial - Java SE 7 API documentation
Scala Notes - My blog about Scala
naved momin
Ranch Hand

Joined: Jul 03, 2011
Posts: 675

Jesper de Jong wrote:
naved momin wrote:which is wrong 2 is not a prime no and 1 is but not getting display

You are mistaken. 2 is a prime number, and 1 is not a prime number. See Prime for why this is so.

thanks buddy
big mistake from my end
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: problem displaying prime no program.
 
Similar Threads
problem with java code
shift
Question from jqplus
I am not getting the required output...
confusing for Loop.