Created
July 27, 2019 18:00
-
-
Save jkotra/c27a39cf5862f54565353c9e43d7535c to your computer and use it in GitHub Desktop.
primes
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
fn main(){ | |
let mut flag = true; | |
for i in 2..100{ | |
for j in 2..i{ | |
if i%j==0{ | |
flag=false; | |
break; | |
}else{ | |
if flag == false{ | |
flag=true; | |
} | |
} | |
} | |
if flag{ | |
println!("{}",i ) | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment