Factors of an integer: Difference between revisions
→{{header|FutureBasic}}
(Factors of an integer in Asymptote) |
|||
Line 2,920:
=={{header|FutureBasic}}==
<lang futurebasic>window 1, @"Factors of an Integer", (0,0,1000,270)
clear local mode
local fn IntegerFactors( f as long ) as
CFStringRef factorStr = @""
for i = 1 to sqr(f)
next i
s = 1
while ( s = 1 )
s = 0
for i = 0 to c-1▼
swap l(i), l(i+1)▼
end if▼
next i▼
wend▼
for i = 0 to c-1
s =
end if▼
▲wend
if ( i < c - 1 )
factorStr = fn StringWithFormat( @"%@ %ld, ", factorStr, l(i) )
else
factorStr = fn StringWithFormat( @"%@ %ld", factorStr, l(i) )
next
end fn = factorStr
print @"Factors of 25 are:"; fn IntegerFactors( 25 )
print @"Factors of 45 are:"; fn IntegerFactors( 45 )
print @"Factors of 103 are:"; fn IntegerFactors( 103 )
print @"Factors of 760 are:"; fn IntegerFactors( 760 )
print @"Factors of 12345 are:"; fn IntegerFactors( 12345 )
print @"Factors of 32766 are:"; fn IntegerFactors( 32766 )
print @"Factors of 32767 are:"; fn IntegerFactors( 32767 )
print @"Factors of 57097 are:"; fn IntegerFactors( 57097 )
print @"Factors of 12345678 are:"; fn IntegerFactors( 12345678 )
print @"Factors of 32434243 are:"; fn IntegerFactors( 32434243 )
HandleEvents</lang>
Output:
|