You are on page 1of 1

Partial class BilanganPrima inherits system.web.

page private fungtion prima (byval angka as integer) as boolean dim i as integer dim tanda as boolean = true select case angka case 1 tanda = false case 2 tanda = true case is > 2 for 1 = 2 to angka-1 if angka mod 1=0 then tanda = false end if next i end select return tanda end function protected sub BtTampilPrima_Click (byval sander as object, byval e as system. Ev entArgs) dim i as integer dim mystring as string for i = clnt(me.TbMulai.Text) to clnt(me.TbAkhir.Text) if prima(i) = true then mystring = mystring & " " & i end if next me.LbTampilPrima.Text = cstr (mystring) enb sub end class

You might also like