Skip to content

Instantly share code, notes, and snippets.

@arruda
Created December 6, 2012 21:45
Show Gist options
  • Save arruda/4228764 to your computer and use it in GitHub Desktop.
Save arruda/4228764 to your computer and use it in GitHub Desktop.
AOU exercicio awk
{num=$1
for (div = 2; div*div <= num; div++)
if (num % div == 0)
break
if (num % div == 0)
printf "%d nao eh primo\n", num
else
printf "%d eh primo\n",num}
echo 5 | awk -f awk_primo
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment