Replace all occurrences of pi with 3.14. Input Integer N, no of lines with one string per line. Output result one per line

My code is working fine without taking custom input-n(no. of strings), but with custom input n, all the strings are not been output. Please help me resolve this issue.
Here is the link to my code: https://ide.codingblocks.com/s/74353

HI @Megha, pls use cin >> str instead of getline method in line 28. Ur program will work fine then.

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.

Thank you! The program works fine now using cin instead of getline. But I still have a doubt. Why does the use of getline leads to a blank line in the starting and missing of last entry in the output ?