Thanks to visit codestin.com
Credit goes to www.scribd.com

0% found this document useful (0 votes)
72 views1 page

Codes

This code takes a user-inputted number, checks if it is prime by testing for divisibility by all integers from 2 to the number-1, and adds any factors to a list. It then adds the original number to the list. A second command button clears the input text box and list when clicked.

Uploaded by

sohamdey
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
72 views1 page

Codes

This code takes a user-inputted number, checks if it is prime by testing for divisibility by all integers from 2 to the number-1, and adds any factors to a list. It then adds the original number to the list. A second command button clears the input text box and list when clicked.

Uploaded by

sohamdey
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 1

DIM N,X AS INTEGER

N=VAL(TEXT1.TEXT)
FOR X=2 TO N-1
IF N MOD X=0 THEN
LIST1.ADDITEM(X)
END IF
NEXT
LIST1.ADDITEM(N)
END SUB

PRIVATE SUB COMMAND2_CLICK()


TEXT1.TEXT=""
LIST1.CLEAR
END SUB

You might also like