Jumat, 25 Desember 2009

Algorithm PRIMA NUMBERS

to make a number of PRIMA algorithm, we must follow the step-langkay the right to create a program that we can be executed and found the results we want. to make the algorithm prime numbers, we must follow the step-langkay the right to create a program that we can not be executed and found the results we want. The following algorithm prime numbers that can be seen mi friend .. The following algorithm prime numbers can be seen that mi friend ..


1. start
2. cekPrima = input (data)
3. for divisor = 2 to cekPrima
4. cekPrima if mod divisor = 0, to step 5, not to the 6
5. jmlFaktor + jmlFaktor = 1
6. if jmlfaktor> 1, divisor = cekPrima, not directly to 7
7. next divider
8. if jmlFaktor = 1, to step 9, not to 10
9. write = "Numbers" cekPrima + + "is the number PRIMA"
10. write = "Numbers" cekPrima + + "is NOT the number PRIMA"
11. output (write)
12. done

or it could be taken by this algorithm.
1. start
2. cekPrima = input (data)
3. divisor = 2
4. if cekPrima mod divisor == 0, "yes" to step 5, "no" to step 6
5. jmlFaktor + jmlFaktor = 1
6. if jmlFaktor> 1, "yes" divisor = cekPrima / / function to complete the direct iteration
7. divisor = divisor + 1
8. recurrence, distributors> cekPrima, "yes" again to step 4, "no" to the next
9. write = "Numbers" cekPrima + + "is the number PRIMA"
10. write = "Numbers" cekPrima + + "is NOT the number PRIMA"
11. output (write)
12. done

Artikel Yang Bersangkutan



Template by : kendhin x-template.blogspot.com