SumAllPrimes

Developer
Size
1,518 Kb
Views
38,456

How do I make an sumallprimes?

What is a sumallprimes? How do you make a sumallprimes? This script and codes were developed by Ben on 08 October 2022, Saturday.

SumAllPrimes Previews

SumAllPrimes - Script Codes HTML Codes

<!DOCTYPE html>
<html >
<head> <meta charset="UTF-8"> <title>sumAllPrimes</title>
</head>
<body> <script src="js/index.js"></script>
</body>
</html>

SumAllPrimes - Script Codes JS Codes

function sumPrimes(num) { if (num<2){return 0} if (num<3){return 2} var primeArr = [2] for (var i=3 ; i<=num ; i+=2){ var primeCond = true for (var j=0; j<primeArr.length; j++){ if (i%primeArr[j]===0){ primeCond=false break } } if (primeCond){ primeArr.push(i) } } var primeSum = 0 for (var k=0; k<primeArr.length; k++){ primeSum+=primeArr[k] } return primeSum;
}
console.log(sumPrimes(10));
console.log(sumPrimes(977))
SumAllPrimes - Script Codes
SumAllPrimes - Script Codes
Home Page Home
Developer Ben
Username bencarp
Uploaded October 08, 2022
Rating 3
Size 1,518 Kb
Views 38,456
Do you need developer help for SumAllPrimes?

Find the perfect freelance services for your business! Fiverr's mission is to change how the world works together. Fiverr connects businesses with freelancers offering digital services in 500+ categories. Find Developer!

Ben (bencarp) Script Codes
Create amazing web content with AI!

Jasper is the AI Content Generator that helps you and your team break through creative blocks to create amazing, original content 10X faster. Discover all the ways the Jasper AI Content Platform can help streamline your creative workflows. Start For Free!