forked from dharmanshu1921/Java
- Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path13.cpp
More file actions
Latest commit
21 lines (21 loc) · 454 Bytes
/
Copy path13.cpp
File metadata and controls
21 lines (21 loc) · 454 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#include<iostream>
usingnamespacestd;
intmain(){
int i,n,count;
cout<<"Enter the value of i";
cin>>i;
if(n<2){
cout<<"Not prime not composite";
}
elseif(n==2){
cout<<"Number is prime"<<endl;
}
else{
for(i=2;i<=n-1;i++)
{if(n%1==0) {count++;}}
if(count>0)
{cout<<"Number is not a prime number"<<endl;}
else{cout<<"Number is a prime number";}
}
return0;
}