Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Changed names to have .rs at the end #112

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
File renamed without changes.
File renamed without changes.
35 changes: 35 additions & 0 deletions src/algorithms_data_structures/number_theory/prime_or_not.rs.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
use std::io;

fn read_int() -> i32 {
let mut num = String::new();

io::stdin()
.read_line(&mut num)
.expect("Error reading number");

num.trim().parse::<i32>().unwrap()
}

fn main() {
let mut n = 0;

let mut flag = 0;

println!("enter a number");

n = read_int();

for i in 2..n / 2 {
if n % i == 0 {
flag = 1;

break;
}
}

if flag == 0 {
println!("is a prime");
} else {
println!("it is not a prime");
}
}
68 changes: 0 additions & 68 deletions src/algorithms_data_structures/number_theory/prime_or_not.rs.txt

This file was deleted.

File renamed without changes.