Skip to content
Snippets Groups Projects
Select Git revision
  • d48edcd327479e7a230e1a34684f251a5cd47337
  • master default protected
  • 2018ws
  • 2017ws
  • 2016ws
5 results

loesung-3-4.c

Blame
  • Forked from Peter Gerwinski / hp
    46 commits behind the upstream repository.
    loesung-3-4.c 283 B
    #include <stdio.h>
    
    int main (void)
    {
      int n, i, divisors;
      for (n = 0; n < 100; n++)
        {
          divisors = 0;
          for (i = 1; i <= n; i++)
            if (n % i == 0)
              divisors++;
          if (divisors == 2)
            printf ("%d ist eine Primzahl.\n", n);
        }
      return 0;
    }