factorialfunction

Crates.iofactorialfunction
lib.rsfactorialfunction
version0.1.1
sourcesrc
created_at2020-05-10 13:12:03.427429
updated_at2020-05-10 17:10:58.074418
descriptionfactorialfunction takes an input of u32 and returns its factorial.
homepagehttps://github.com/shawais786/factorialfunction.git
repositoryhttps://github.com/shawais786/factorialfunction.git
max_upload_size
id239635
size15,807
Owais Ishfaq (shawais786)

documentation

README

factorialfunction

Function named factorial() takes input of positive integer and shows its factorial If a positive integer is not entered, the function will keep on taking an input until a positive integer is entered. To reduce the size, u32 variables are used hence you can enter from 0 ~ 12 to get factorial. Function will return the factorial of the value entered by you.

To use this library you have to add following line in [dependencies] section of Cargo.toml factorialfunction = "0.1.0"

Your cargo.toml file should look like this:

.
.
.
edition = "2018"

[dependencies]
factorialfunction = "0.1.0"

In src/main.rs you can use like this:

use factorialfunction;
fn main() {
    println!("Hello, world!");
    factorialfunction::factorial();
}

Following will also work:

use factorialfunction::factorial;
fn main() {
    println!("Hello, world!");
    factorial();
}

now cargo run for results

Commit count: 17

cargo fmt