Redundant Parantheses

Please refer line 11 and 12, I’m confused when to use cin and when to use getline.

To elaborate, I don’t understand that logic of input buffer due to which we use getline/cin.

Request you to please help me out.

Hey @gambhirrahul0


Getline will take input, unless and until it encounter a delimiter , by default it takes ‘/n’ as a delimiter. So if you have to take input as a line, use getline. Else use cin, cause what cin does, it takes input until amd unless it hits a space, when you will hit a space, it will stop taking input.
If have any doubt, ask me here only. Will try my best to clear your doubts

Thanks for the clarification. I’m closing the doubt.

If you have any other doubt, you can ask.

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.