Skip to content

Commit

Permalink
Merge pull request #546 from SwagsShivamOp/patch-3
Browse files Browse the repository at this point in the history
Create Prime_in_a_Range
  • Loading branch information
gantavyamalviya authored Oct 5, 2022
2 parents b7da6d0 + 8c09917 commit 2afd88f
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions Prime_in_a_Range
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#include <iostream>
using namespace std;
int main(){
int i,j,a,b;
cin>>a>>b;

for(i=a;i<=b;i++){
for(j=2;j<i;j++){
if(i%j==0){
break;
}
}

if(j==i){
cout<<i<<" \t ";
}
}

return 0;
}

0 comments on commit 2afd88f

Please sign in to comment.