Analysis program:

Already know it primes?? A prime number (or a prime) is a natural number that has exactly two distinct natural number divisors1 and itself. For example, we input the number 3 it will be in the process with thisprogram that the results are excellent.

Algorithm:
1. Suppose this number is X.
2. number is even or odd.
3. If the numbers are completed (except 2) means not a prime number.
4. Numbers were only divisible by 1 and the number itself or not?
5. If not, then not a prime number.
6. If so, then the prime numbers.

Program :

[sourcecode language="css"]
#include <iostream.h>

class prima
{
public:
prima();
input();
proses();
private:
int bil, batas, x, i;
};

prima::prima()
{ cout<<"Menentukan bilangan prima atau bukan"<<endl<<endl;}
prima::input()
{ cout << "Masukkan bilangan : ";
cin >> x;
cout<<endl;}
prima::proses(){
batas = 0;
for ( i=1; i<=bil; i++)
{
if (bil%i==0 && x !=0)
batas++; }

if (batas==2){
cout << "Termasuk bilangan prima \n"; }
else {
cout << "Bukan bilangan prima \n";}
}

int main()
{
prima bilangan;
bilangan.input();
bilangan.proses();

}
[/sourcecode]