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
krishnasamy
(83)
Karthikeyan S
(80)
Rajesh(March-20...
(68)
Last 7 Days
D.Jeya kumar(J...
(1198)
Athira Appukut...
(1137)
UltimateRengan
(1134)
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
pagin in the datagrid.
How to get IP Address in VB.net
How to change upper case of 'cmbobox' in vb.net
How to read data from an Excel spreadsheet into dataset
Running application from another system
dotNet Slackers
BizTalk Adaptors
Web Design
web conferencing
Contact Us
Privacy Policy
Terms Of Use