SumAllPrimes
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 - 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))
Developer | Ben |
Username | bencarp |
Uploaded | October 08, 2022 |
Rating | 3 |
Size | 1,518 Kb |
Views | 38,456 |
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!
Name | Size |
What is in Name | 1,749 Kb |
DalaiLamasQuotes | 2,776 Kb |
Comparisons of Arrays and Objects | 1,436 Kb |
Twitch Channels | 3,723 Kb |
MakeAPerson | 1,763 Kb |
A Pen by Ben | 2,991 Kb |
About Me Page | 3,220 Kb |
PairWise | 1,532 Kb |
TESTS | 1,379 Kb |
Symmetric Difference | 1,747 Kb |
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!
Name | Username | Size |
Responsive Minimal Blog Layout | Hackthevoid | 5,261 Kb |
Project_one | MOHIM | 9,592 Kb |
Welcome | Nakome | 6,076 Kb |
3d css cube | Semenchenko | 4,578 Kb |
Highbrow Basic HTML Lesson 8 | Kimlarocca | 2,094 Kb |
A Pen by Kenny Mark | Kennymark | 5,574 Kb |
Profile box | Daniesy | 2,766 Kb |
IbrahimJabbari-Effect14 | Ibrahimjabbari | 1,919 Kb |
Simple Buttons | Haydenmills | 1,750 Kb |
Highbrow Basic HTML Lesson 7 | Kimlarocca | 1,662 Kb |
Surf anonymously, prevent hackers from acquiring your IP address, send anonymous email, and encrypt your Internet connection. High speed, ultra secure, and easy to use. Instant setup. Hide Your IP Now!