You can get input for the console most of the time. Of course, you could get user input from other sources as well, such as the mouse, the microphone, various game controllers, and whatnot. Online GDB runs on a remote server, so we're limited to console (standard input).
You have various functions in various languages. For instance, in Python, you'd use input(). In C, you'd use scanf().
What's your language?