Start learning free

LESSON 36 OF 348 · FUNCTIONS I

Exercise: Create Function in Rust in Rust

Practice

We've wrritten this code:

fn main_function() {
	println!("Hello AlgoCademy!");
	println!("Coding is amazing!");
	println!("Functions are so useful!");

	println!("Hello AlgoCademy!");
	println!("Coding is amazing!");
	println!("Functions are so useful!");

	println!("Hello AlgoCademy!");
	println!("Coding is amazing!");
	println!("Functions are so useful!");
}

Write the same code in a better way by creating and calling a function print_messages()

STEP 1 OF 2
    Ctrl + Enter to check

    Exercise Create Function in Rust

    Keep going with RustAbout 340 step-by-step lessons, from your first line of code to coding interviews. Free to start.
    Start learning free