New Exercises resolved

This commit is contained in:
Faiizan Hussain 2023-12-01 17:39:37 +00:00
parent 06e5fd8ae2
commit e2a53eaeed
3 changed files with 8 additions and 2 deletions

View File

@ -3,7 +3,6 @@
// Execute `rustlings hint functions5` or use the `hint` watch subcommand for a // Execute `rustlings hint functions5` or use the `hint` watch subcommand for a
// hint. // hint.
// I AM NOT DONE
fn main() { fn main() {
let answer = square(3); let answer = square(3);

View File

@ -2,13 +2,18 @@
// //
// Execute `rustlings hint if1` or use the `hint` watch subcommand for a hint. // Execute `rustlings hint if1` or use the `hint` watch subcommand for a hint.
// I AM NOT DONE
pub fn bigger(a: i32, b: i32) -> i32 { pub fn bigger(a: i32, b: i32) -> i32 {
// Complete this function to return the bigger number! // Complete this function to return the bigger number!
// Do not use: // Do not use:
// - another function call // - another function call
// - additional variables // - additional variables
if a > b {
return a;
} else {
return b;
}
} }
// Don't mind this for now :) // Don't mind this for now :)

View File

@ -7,6 +7,8 @@
// I AM NOT DONE // I AM NOT DONE
pub fn foo_if_fizz(fizzish: &str) -> &str { pub fn foo_if_fizz(fizzish: &str) -> &str {
if fizzish == "fizz" { if fizzish == "fizz" {
"foo" "foo"