Question: I am not able to meet all the conditions of prime factors of a number so that I find the correct sum. 

```
    int sumPrime(number){

         int counter;
         int sum=0;
         for(counter=2;counter<=(number/2);counter++){
           if(number%counter==0){
              sum=counter;
              counter++;
              sum+=counter;

              }
           return sum;  

          }
    }

```

Answer: 
```
#include <stdio.h>

int main(){

    printf("sum is%i",sumCount(12));
    return 0;
}
int sumCount(int number){
int count,sum=0;
for(count=2;count<number;count++){
    if(isPrime(count)==1){
        printf("%i \n",count);
        sum+=count;
    }
}
return sum;
}
int isPrime(int number){
    int i;
    for (i=2;i<=number/2 ;i++){
        if(number%i==0){
        return 0;
    }
}
return 1;
}

```
```js
let n = 22;
let sum = 0;

function sumOfPrimeFactors(n) {
  // Write your code here
  if(n === 2){
    return true;
  }
  if(n < 2 || isNaN(n) || (n%2===0)){
    return false;
  }
  for(let i = 3; i < n; i++){
    if(n%i === 0){
      return false;
    }
  }
  return true;
}

for(let i = 0; i <= n; i++){
  if(sumOfPrimeFactors(i) === true){
    if(n % i === 0){
      sum += i;
    }
  }
}
console.log(`The sum of the prime factors in 91 is: ${sum}`)

```