* IT IS IT *
Monday, April 16, 2012
PRIMA
#include <iostream.h>
#include <conio.h>
void main ()
{
int a,b,c;
cout<<"Bilangan Prima:\n";
for (a=2;a<=100;a++)
{
c=0;
for (b = 2; b<a;b++)
{
if (a % b ==0)
{
c=1;
}
}
if (c == 0)
{
cout<<a<<", ";
}
}
getch();
}
No comments:
Post a Comment
Newer Post
Older Post
Home
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment