fork download
  1. include <stdio.h>
  2. int main()
  3. { int i,n,count=0
  4. printf("Enter n: ");
  5. scanf("%d",&n);
  6. for (i=1;i<=n;i++)
  7. { if (n%i==0)
  8. printf ("%d is a prime.",n);
  9. else
  10. printf("%d is not a prime.",n);
  11.  
Success #stdin #stdout 0.03s 25744KB
stdin
Standard input is empty
stdout
include <stdio.h>
int main()
    { int i,n,count=0
    printf("Enter n: ");
    scanf("%d",&n);
    for (i=1;i<=n;i++)
    { if (n%i==0)
         printf ("%d is a prime.",n);
         else
         printf("%d is not a prime.",n);