You can use the small newlib library for a smaller code footprint, but there are naturally some disadvantages.
https://www.altera.com/content/dam/altera-www/global/en_US/pdfs/literature/hb/nios2/n2sw_nii5v2.pdf
So be careful if you are using one of such input routines.
// Nios II - Prog/main.c #include "sys/alt_stdio.h" while (1) { c = alt_getchar(); alt_putchar(c);