Write a MATLAB script to find the sum of all prime numbers between 1 and 500

7 views (last 30 days)
Write a MATLAB script to find the sum of all prime numbers between 1 and 500

Answers (1)

David Hill
David Hill on 14 Aug 2022
sum(primes(500))

Tags

Products


Release

R2022a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!