When do i requred to clean the input buffer?

see line number 50 here on ide, please provide the respective inputs for running

why this code is not running fine on ide? its not displaying the value for array ‘e’

its running on my atom editor with mingw but i need to do fflush. so please tell me when when do we need to clear the input buffer?

it is used when u have to take character or string input from user mainly cauz without it , getline includes previous inputs or enter (newline)…
ps: Correct me if i am wrong as i m not sure of any other case…