Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR SWIFT

Prime number or not program in swift basic programs

var value=0var n = 10var i = 2for i in 2 ... n-1{    if(n%i==0)    {        value = 1;        break;    }}if(value==1){    print("(n)" + " not prime")}else{    print("(n)" + "  prime")}
Source by inlarn.com #
 
PREVIOUS NEXT
Tagged: #Prime #number #program #swift #basic #programs
ADD COMMENT
Topic
Name
6+6 =