To find the sum of prime numbers in a given list of numbers, follow this algorithm:
- Initialize a sum variable to 0 to keep track of the sum of prime numbers.
- For each number in the input list, perform the following steps:
- Check if the number is greater than 1, because prime numbers are greater than 1.
- Check if the number is prime by trying to divide it by all smaller numbers from 2 up to its square root. If it is divisible by any such number, it is not prime.
- Start a loop from 2 to the square root of the number.
- If the current number is divisible by any of these numbers, it's not a prime number. Break the loop and consider the next number in the list.
- If the number is prime (i.e., it passes the above check), add it to the sum.
- After checking all numbers, return or output the sum of the prime numbers.