Skip to content

Instantly share code, notes, and snippets.

View madhusudan12's full-sized avatar
👻

Madhusudan chowdary madhusudan12

👻
View GitHub Profile
@madhusudan12
madhusudan12 / prime.rs
Created June 25, 2019 15:02
finds the list of prime numbers from 2..n, given n.
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;