Skip to content

Instantly share code, notes, and snippets.

Created May 15, 2013 20:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save anonymous/5587152 to your computer and use it in GitHub Desktop.
Save anonymous/5587152 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