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

5 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))

Categories

Find more on 2-D and 3-D Plots in Help Center and File Exchange

Tags

Products


Release

R2022a

Community Treasure Hunt

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

Start Hunting!