We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 2bc184b commit 5ae41b0Copy full SHA for 5ae41b0
primenosfun.c
@@ -0,0 +1,29 @@
1
+#include<stdio.h>
2
+void prime();
3
+void main()
4
+{
5
+int n;
6
+printf("Enter the number");
7
+scanf("%d",&n);
8
+prime(n);
9
+}
10
+
11
+void prime(int a)
12
13
+ if (a==1)
14
+ {
15
+ printf("Neither prime nor composite");
16
+ }
17
+ else if(a==2||a==3||a==5||a==7)
18
19
+ printf("Prime");
20
21
+ else if(a%2==0||a%3==0||a%5==0||a%7==0)
22
23
+ printf("NOT PRIME");
24
25
+ else
26
27
+ printf("PRIME");
28
29
0 commit comments