Browse Source

refactoring: added comments in main

remotes/origin/primzahl
Hendrik Sitzmann 11 months ago
parent
commit
a98e9ecc18
  1. 3
      src/primzahl/main.c

3
src/primzahl/main.c

@ -3,10 +3,13 @@
#include <stdio.h> #include <stdio.h>
int main() { int main() {
// set the smallest possible input
int minInput = 0; int minInput = 0;
//get user input
int num = usergetd("Enter a positive number: ", minInput, NULL); int num = usergetd("Enter a positive number: ", minInput, NULL);
//check if its a prime number or not
if (primzahl(num)) if (primzahl(num))
printf("%d is a prime number.\n", num); printf("%d is a prime number.\n", num);
else else

Loading…
Cancel
Save