Skip to content

Commit

Permalink
improve function with other functions and comments
Browse files Browse the repository at this point in the history
  • Loading branch information
AlphonseMehounme committed Nov 26, 2024
1 parent bff37ee commit 789ff7c
Showing 1 changed file with 17 additions and 1 deletion.
18 changes: 17 additions & 1 deletion Rust/functions.rs
Original file line number Diff line number Diff line change
@@ -1,17 +1,33 @@
// Main function
fn main() {
println!("Hello, Satoshi!");

println!("-----Wallet-----");

another_function(99999);

print_labeled_measurement(21000, 's')
print_labeled_measurement(21000, 's');

let x = {
let y = 6;
y + 1
};
println!("Value of x is: {x}.");
let x = five();
println!("Value of x is now: {x}.")
}

// Simple function that print provided Bitcoin Price
fn another_function(x: i32) {
println!("The Bitcoin price is {x}");
}

// Function that prints value and unit
fn print_labeled_measurement(value: i32, unit_label: char) {
println!("Bitcoin Balance : {value}{unit_label}");
}

// Function that returns 5
fn five() -> i32 {
5
}

0 comments on commit 789ff7c

Please sign in to comment.