Use of cin.get in largest

when i am declaring cin.get() before the loop for taking 4 input it is still giving me the same output as without the use of cin.get before for loop.

I cannot get your question. Please elaborate. Also please save your code on ide.codingblocks.com and share its link.

my doubt here is


when I taking 4 inputs and also passing the cin.get() for declaring and deleting the null character space present by default in memory then also, m able to take only 3 inputs. check my code largest should be then last one in inputs.

cin.get(); in the beginning is not required. Also after that you are using getline…so cin.get() is not required.
Refer this https://stackoverflow.com/questions/29630513/difference-between-cin-and-cin-get-for-char-array
This may help.

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.

1 Like