#include <stdio.h>
int main()
{
printf("Please enter an integer for analysis; Enter q to quit.\n");
int n, div;
int isprime = 1;
scanf("%d",&n);
for(div = 2; (div*div)<=n; div++)
{
if(n % div == 0)
{
if(div*div != n)
{
printf("%d is divisible by %d and %d.\n", n, div, n / div);
}
else
{
printf("%d is divisible by %d.\n", n, div);
}
isprime = 0;
}
}
if(isprime)
{
printf("%d is prime.\n", n);
}
return 0;
}