prime numbers

Page 1 of 1

1 Replies - 3977 Views - Last Post: 05 March 2010 - 06:22 AMRate Topic: //<![CDATA[ rating = new ipb.rating( 'topic_rate_', { url: 'http://www.dreamincode.net/forums/index.php?app=forums&module=ajax&section=topics&do=rateTopic&t=159885&amp;s=48c37ab1289081075e23dabe45cccb11&md5check=' + ipb.vars['secure_hash'], cur_rating: 0, rated: 0, allow_rate: 0, multi_rate: 1, show_rate_text: true } ); //]]>

#1 mani2012

Reputation: -2
• Posts: 1
• Joined: 04-March 10

prime numbers

Posted 04 March 2010 - 07:58 PM

i need a prime numbers in console application in vb.net
Is This A Good Question/Topic? -2

Replies To: prime numbers

#2 clboyrun

Reputation: -4
• Posts: 14
• Joined: 19-January 10

Re: prime numbers

Posted 05 March 2010 - 06:22 AM

```Dim Input as Double = System.Console.Readline()
Dim IsPrime as Boolean = True

If Input / 2 = Input \ 2 then
IsPrime = False
EndIf

If Input / 3 = Input \ 3 then
IsPrime = False
EndIf

If Input / 5 = Input \ 5 then
IsPrime = False
EndIf

If Input / 7 = Input \ 7 then
IsPrime = False
EndIf

If Input / 11 = Input \ 11 then
IsPrime = False
EndIf

If Input / 13 = Input \ 13 then
IsPrime = False
EndIf

If Input / 17 = Input \ 17 then
IsPrime = False
EndIf

If Input / 19 = Input \ 19 then
IsPrime = False
EndIf

If Input / 23 = Input \ 23 then
IsPrime = False
EndIf

If Input / 31 = Input \ 31 then
IsPrime = False
EndIf

'And So On...

If IsPrime = True Then
System.Console.WriteLine("This Is A Prime Number")
Else
System.Console.WriteLine("This Is Not A Prime Number")

```

Hope This Helps