2021-08-23 12:42:16 +03:00
|
|
|
#include<stdio.h>
|
|
|
|
|
|
|
|
int main(int argc, char *argv[]) {
|
|
|
|
int number;
|
|
|
|
int dividers = 0, i = 1;
|
|
|
|
printf("Enter number: ");
|
|
|
|
scanf("%d", &number);
|
|
|
|
while (i <= number) {
|
2021-08-24 15:23:36 +03:00
|
|
|
if (number % i++ == 0) {
|
2021-08-23 12:42:16 +03:00
|
|
|
dividers++;
|
|
|
|
} else {
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
if (dividers == 3)
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
printf("Number %d is%s prime",
|
|
|
|
number,
|
|
|
|
(dividers == 2) ? "" : " not"
|
|
|
|
);
|
|
|
|
}
|