The macro println! in Rust always leaves a newline character at the end of each output. For example
println!
println!(\"Enter the number : \"); io::stdin
You can use the print! macro instead.
print!("Enter the number : "); io::stdin().read_line(&mut num);
Beware:
Note that stdout is frequently line-buffered by default so it may be necessary to use io::stdout().flush() to ensure the output is emitted immediately.