For example:
C:\> Input a number: 60
Where the output would be "Input a number: " and the input would be "60".
How do I get these to be on the same line?
The problem is when I output "Input a number: ", it automatically starts a new line, so the user inputs "60" underneath (on the next line).
printf("start:\n"); printf("\nline 1. printed");
'\r' is the carriage return character.
The C programming language provides many standard library functions for file input and output.
We can take string input in C using scanf(“%s”, str).
Use System.Console.Write
instead of System.Console.WriteLine
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With