I'm surprised that this challenge isn't already here, as it's so obvious. (Or I'm surprised I couldn't find it and anybody will mark it as a duplicate.)
Task
Given a non-negative integer \$n\$, calculate the sum of the first \$n\$ primes and output it.
Example #1
For \$n = 5\$, the first five primes are:
- 2
- 3
- 5
- 7
- 11
The sum of these numbers is \$2 + 3 + 5 + 7 + 11 = 28\$, so the program has to output \$28\$.
Example #2
For \$n = 0\$, the "first zero" primes are none. And the sum of no numbers is - of course - \$0\$.
Rules
- You may use built-ins, e.g., to check if a number is prime.
- This is code-golf, so the lowest number of bytes in each language wins!