Your question is too vague and broad to give an actual concise answer. However from what I'm gathering from your question as well as the comments listed below it, it appears that you are working with Windows and are tasked with writing a win32 console application where you have to manipulate the console to accept input that is right aligned.
What I can do for you here is point you in a direction that may give you the answers you are looking for. You can find the documentations for the Windows Console API here: https://learn.microsoft.com/en-us/windows/console/ There is quite a bit of information about everything you need to know on how to acquire a handle to the console, to getting the console buffer, info structures etc. How to manipulate the buffer size, the cursor position, changing font type, size & color(foreground, background and highlighted text). Other than that I will have to agree with the rest of the community that your initial question was too vague and broad and that it has the impression of a X/Y problem.