수행평가 1차:
다음 입·출력 설계을 참고하여 입력한 수까지의 소수의 개수를 구하는 프로그램을 만들어보세요.


코드 입력 하기 편집

Private Sub Command1_Click()

 Dim i As Integer, j As Integer
Dim prime As Boolean
Dim Count As Integer

Count = 0

  Count = Count + 1

For i = 2 To 10

  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 Count

  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