Skip to content

Instantly share code, notes, and snippets.

@edymanoloiu
edymanoloiu / prim
Created June 11, 2012 10:30
find prime numbers in a vector
#include<stdio.h>
#include<stdlib.h>
#include<math.h>
int prim (int n)
{
int i,aux=sqrt(n);
for(i=2; i<=aux; i++)
if(n%i==0)
return 0;
return 1;