Tutorials
Resources
Forum
Interview
Jobs
Projects
Offshore Development
Mentor
|
Code Converter
|
Articles
|
Code Factory
|
Computer Jokes
|
Members
|
Peer Appraisal
|
IT Companies
|
Bookmarks
|
Revenue Sharing
|
Talk to Us
|
My Profile
Sign In
Register
AdSense Revenue
Gifts
Active Members
Today
vipul
(176)
ANIL PANDEY
(141)
UltimateRengan
(140)
Last 7 Days
UltimateRengan
(844)
D.Jeya kumar(J...
(745)
Athira Appukut...
(661)
more...
Generate All Prime No. Between Given Number
Posted Date: 04 Jul 2008 Resource Type:
Code Snippets
Category:
VB.NET Syntax
Posted By:
Afsar
Member Level:
Bronze
Rating:
Points
: 2
Public Class Form1
Dim X As Integer
Dim Y As Integer
Dim flag As Boolean
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
ListBox1.Items.Clear()
For Y = 1 To Val(TextBox1.Text)
flag = True
For X = 2 To Y
If X = Y Then
If flag = True Then
ListBox1.Items.Add(Y)
Exit For
End If
Else
If (Y Mod X = 0) Then
flag = False
End If
End If
Next
Next
Label1.Text = "Total No. of Prime No. - " & ListBox1.Items.Count
End Sub
End Class
Responses
No responses found. Be the first to respond and make money from
revenue sharing program
.
Feedbacks
Popular Tags
What are tags ?
Search Tags
Sign In
(No tags found.)
Post Feedback
This is a strictly moderated forum. Only approved messages will appear in the site. Please use 'Spell Check' in Google toolbar before you submit.
You must
Sign In
to post a response.
Next Resource:
Getting text from Text file
Previous Resource:
Change Desktop Wallpaper using VB.NET
Return to Discussion Resource Index
Post New Resource
Category:
VB.NET Syntax
Post resources and
earn money
!
Related Resources
Singleton Example
How to read data from an Excel spreadsheet into dataset
Convert Bitmap to Another Image Format
Palindrome Word
Display a RandomImage on Page Load using Sessions
dotNet Slackers
BizTalk Adaptors
Web Design
doors in nj
Contact Us
Privacy Policy
Terms Of Use