Use of cin.get()

why did we used cin.get over there ?

@Saumya123456789
after cin>>n, cin has till the value of n.
Then Actually cin start reading from the point we left. So after the value of n, there is a newline character which we need not to consider, so using cin.get() just removes the newline character.

@Saumya123456789 please also mark this doubt as resolved if you understood it.

you have reopen the doubt

you have some questions regarding this??

if it is open by mistake then mark is as resolved again