Answers for "int / int < float rust"

2

how to add integer and float in rust

fn main(){
    let x:f32=20.0;        
    let y:i32=10;
    let sum = x + y as f32;
    println!("{}",sum);
}
Posted by: Guest on August-30-2021

Browse Popular Code Answers by Language