Answers for "converting int to 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

Code answers related to "converting int to float rust"

Browse Popular Code Answers by Language