Answers for "print number as binary in rust"

0

print number as binary in rust

println!("{:b}", 11); // 1011
    println!("{:#b}", 11); // 0b1011
    println!("{:010b}", 11); // 0000001011 // width
    println!("{:#010b}", 11); // 0b00001011 // width - 2
Posted by: Guest on March-28-2022

Browse Popular Code Answers by Language