summaryrefslogtreecommitdiff
path: root/asal_tester.c
diff options
context:
space:
mode:
authorb4rkod <void@Asena.localdomain>2024-01-17 21:17:07 +0300
committerb4rkod <void@Asena.localdomain>2024-01-17 21:17:07 +0300
commitb03b61b232c1fa0b9ff1ae607232f8ab3f55ea38 (patch)
tree9169255eae57e59035595768e8dd46cfaba28f50 /asal_tester.c
parent2fa043277b090a37b3f378a2fefccc57b5bd2814 (diff)
Diffstat (limited to 'asal_tester.c')
-rw-r--r--asal_tester.c22
1 files changed, 22 insertions, 0 deletions
diff --git a/asal_tester.c b/asal_tester.c
new file mode 100644
index 0000000..730d6cd
--- /dev/null
+++ b/asal_tester.c
@@ -0,0 +1,22 @@
+#include <stdio.h>
+
+int
+asal_test(int a)
+{
+ short f = 1;
+
+ for ( int i = 2; i <= a/2; i++ ) {
+ if ( (a % i) == 0 ) {
+ f = 0;
+ break;
+ }
+ }
+ return f;
+}
+
+int main() {
+ int num;
+ scanf("%d",&num);
+
+ printf("\n asal mi? %d\n",asal_test(num));
+}