first commit

This commit is contained in:
Ashborn 2025-12-16 22:10:06 +05:45
commit a66604eb6c
52 changed files with 790 additions and 0 deletions

20
functions/src/main.rs Normal file
View file

@ -0,0 +1,20 @@
/*
function is a block or reusable code.
defining the function if fn keyword, and every Rust programs starts with this main function.
*/
fn main() {
greet();
println!("{}", multiple(5, 5));
}
fn greet() {
println!("namaste!")
}
/*
[parameterized function]
no type given is directly compliation error, so type annotatin is important
*/
fn multiple(a: i32, b: i32) -> i32 {
a * b
}