#include <iostream>
usingnamespace std;
int main()
{
int number, value=0, x=2;
cout<<"number : ";
cin>>number;
while (x<number && value==0)
{
if (number % x ==0)
{
value=1;
}
else
{
x=x+1;
}
}
if (value==1)
cout <<"The number is a GOOD number " << endl ;
else
cout <<"The number is a BAD number" <<endl;
system("PAUSE");
return 0;
}
== is the test for equality. if (value==1) means "if value is equal to 1"
What is the program doing? Well, it uses the terms good and bad which are arbitrary labels. However, this looks like a common algorithm which crops up very frequently on these forums.