다음 폼처럼 입력한 수까지 소수를 출력하는 프로그램을 만드세요..


코드 입력 하기 편집

Private Sub Command1_Click()

 Dim i As Integer, j As Integer    
Dim Prime As Boolean

For i = 2 To Text1. Text

   Prime = True                    
For j = 2 To i - 1
If i Mod j = 0 Then
Prime = False
Exit For
End If
Next j
If Prime Then
Print i
End If
Next i

End Sub

Ad blocker interference detected!

Wikia is a free-to-use site that makes money from advertising. We have a modified experience for viewers using ad blockers

Wikia is not accessible if you’ve made further modifications. Remove the custom ad blocker rule(s) and the page will load as expected.

Also on FANDOM

Random Wiki