Scripts
global
prime
power
newtonraphson
fibonacci
file
multithread
digitcubes
perfectseries
perfecttest
kapreckerNumber
kapreckerConstant
hawkresponse
entityTemplate
array
multipleAssignment
global
prime
power
newtonraphson
fibonacci
file
multithread
digitcubes
perfectseries
perfecttest
kapreckerNumber
kapreckerConstant
hawkresponse
entityTemplate
array
multipleAssignment
alias mm=MathModule
function main()
{
var x = `exec checkPrime(997)`
if( x == 1)
{
echo "prime"
}
else
{
echo " not prime"
}
}
function calculateSquareRoot(var x)
{
return `exec sqrt(x)`
}
//This checks if a number is prime or not
function checkPrime(var x)
{
for(var i=2; i<`exec calculateSquareRoot(x)`;i=i+1)
{
if( x%i == 0)
{
return 0
}
}
return 1
}
function main()
{
var x = `exec checkPrime(997)`
if( x == 1)
{
echo "prime"
}
else
{
echo " not prime"
}
}
function calculateSquareRoot(var x)
{
return `exec sqrt(x)`
}
//This checks if a number is prime or not
function checkPrime(var x)
{
for(var i=2; i<`exec calculateSquareRoot(x)`;i=i+1)
{
if( x%i == 0)
{
return 0
}
}
return 1
}
prime