blog iseng iseng
Sunday 24 July 2011
how to determine prime number
this program will determine whether input is prime number or no, whats is prime number.
prime number is a natural number that has exactly two distinct natural number divisors: 1 and itself.
this is program how to determine prime number....
#include
#include
using namespace std;
int main(int argc, char *argv[])
{
int bil,s,cek,f;
cout<<"Masukkan bilangan : "; cin>>bil;
for(s=1;s<=bil;s++) { cek=0 ; for(f=1;f<=bil;f++) { if(s%f==0) {cek++;} } } if(cek==2) {cout<
final result in dev :
No comments:
Post a Comment
Newer Post
Older Post
Home
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment