Skip to content

Commit

Permalink
Create prime_number
Browse files Browse the repository at this point in the history
  • Loading branch information
md1altamash authored Oct 19, 2024
1 parent 41cbb6d commit 701550e
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions C++/prime_number
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
//Write a program to print all prime number in between 1 to 100.
#include<iostream>
using namespace std;
int main(){
int n;
for(n=2;n<=100;n++){
if(n%2==0 || n%3==0 || n%5==0){
continue;

}else
cout<<n<<endl;
}
}

0 comments on commit 701550e

Please sign in to comment.