home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
C Programming Starter Kit 2.0
/
SamsPublishing-CProgrammingStarterKit-v2.0-Win31.iso
/
bc45
/
tprofexm.pak
/
PRIME1.C
< prev
next >
Wrap
C/C++ Source or Header
|
1997-07-23
|
405b
|
23 lines
/* Copyright (c) 1990, 1992, Borland International */
#include <stdio.h>
int prime(int n)
{
int i;
for (i=2; i<n; i++)
if (n % i == 0)
return 0;
return 1;
}
void main(void)
{
int i, n;
n = 1000;
for (i=2; i<=n; i++)
if (prime(i))
printf("%d\n", i);
}