Skip to content

Instantly share code, notes, and snippets.

Avatar
👻

Madhusudan chowdary madhusudan12

👻
View GitHub Profile
@madhusudan12
madhusudan12 / prime.rs
Created Jun 25, 2019
finds the list of prime numbers from 2..n, given n.
View prime.rs
use std::io;
fn find_prime(n:i32) -> Vec<i32>{
let mut prime_list: Vec<i32> = Vec::new();
let mut flag:bool;
for i in 2..n{
flag = false;
for j in 2..(i / 2 + 1){
if i%j == 0 {
flag = true;