Get no ouput for string

why no output is there?-https://ide.codingblocks.com/s/200488
but here I got output-https://ide.codingblocks.com/s/200489

@Arnabiswas
After cin>>n;
Do cin.get();

Because getline(cin,s) will take input after n which is enter or newline in programming

You can also replace getline(cin,s) with cin>>s;

If your doubt is resolved please mark it as closed.

1 Like

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.