C# Tutorials and offshore development in India
    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

Gifts

Active Members
TodayLast 7 Days 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  
(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



dotNet Slackers   BizTalk Adaptors    Web Design

web conferencing

Contact Us    Privacy Policy    Terms Of Use