You can do it, but the simplest way makes it so that your program can only run on Windows, which may or may not matter. If it does matter, then skip all of this.
at the top of your program. Then add these two functions to your program:
Then call the Maximize function at the start of main, and the Restore function at the end .
HWND consoleWindow = GetConsoleWindow(); // This gets the value Windows uses to identify your output window
ShowWindow(consoleWindow, SW_MAXIMIZE); // this mimics clicking on its' maximize button
HWND consoleWindow = GetConsoleWindow(); // Same as above
ShowWindow(consoleWindow, SW_RESTORE); // this mimics clicking on its' maximize for a second time, which puts it back to normal
If you need your program to work on Linux or Mac too, google for 'ncurses' which probably has equivalent functionality.