Skip to content

Instantly share code, notes, and snippets.

@jpolvora
Forked from anonymous/gist:5587152
Created May 16, 2013 14:11
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save jpolvora/5592001 to your computer and use it in GitHub Desktop.
#include <stdio.h>
int main (void)
{
int num,cont;
scanf("%d", &num);
for(cont = 2;(cont < num) && (num%cont!=0); cont++){
if(num==cont)
printf("primo\n");
else
printf("nao primo\n");
return 0;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment