This preview has intentionally blurred sections. Sign up to view the full version.View Full Document
Unformatted text preview: Generate: takes an array and a number It should give you all the prime numbers int another ; use a for loop to change the contents of the array use another for loop j = 0 size = 0 for ( i=0, i < n-1, i++) if primes [j] = another ; size ++ j ++ after this loop the array will contain the prime numbers and the size + + will tell you how many prime numbers you filled Boolean function: String array: Sum Array: Int sumArray (const int array , int numterms); Int sum = 0, I; For (i=0, i<numterms, i++) Sum = sum + array [i]; Return sum;...
View Full Document
- Fall '08
- Prime Numbers, Array, Prime number