Your program is working but is waiting for an EOL character.
scanf
is line oriented so it waits for a new line before processing. Try running your program and then hit the enter key.
The solution is to use something else that doesn't need a new line to read the input and then use sscanf to parse the values out.
You will also need to make stdin non-blocking or you won't get the input until the buffer is full or stdin is closed. See this question Making stdin non-blocking
You should also call fflush(stdout);
after your printf to ensure it is actually written (printf is often line buffered so without a newline it may not flush the buffer).