Skip to content

Latest commit

 

History

History
52 lines (41 loc) · 671 Bytes

File metadata and controls

52 lines (41 loc) · 671 Bytes

Rust Programming language

For Loop in rust

use std::io;

//class ::hello!{

//}

fn main() {
let mut ok=["apple","banana"];

 for i in ok {
    println!("Hello,{i} world!");}
}
Program Output:
Hello,apple world!
Hello,banana world!

this is my first rust code wonder full fasdf hello

use std::io;

//class ::hello!{

//}

fn main() {
let mut ok=["apple","banana"];

 for i in ok {
    println!("Hello,{i} world!");}
let mut guess =String::new();
    io::stdin()
    .read_line(&mut guess)
    .expect("Failed to read line");
    println!("{guess}");
    
}
Program Output:
Hello,apple world!
Hello,banana world!
hello okdfsd