Skip to content

Commit 2afd88f

Browse files
Merge pull request codemistic#546 from SwagsShivamOp/patch-3
Create Prime_in_a_Range
2 parents b7da6d0 + 8c09917 commit 2afd88f

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

Prime_in_a_Range

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
#include <iostream>
2+
using namespace std;
3+
int main(){
4+
int i,j,a,b;
5+
cin>>a>>b;
6+
7+
for(i=a;i<=b;i++){
8+
for(j=2;j<i;j++){
9+
if(i%j==0){
10+
break;
11+
}
12+
}
13+
14+
if(j==i){
15+
cout<<i<<" \t ";
16+
}
17+
}
18+
19+
return 0;
20+
}

0 commit comments

Comments
 (0)