CPP-cin vs cin.get video doubt

#include
using namespace std;
int main()
{
char ch;
ch=cin.get();
while(ch!=’\n’)
{
cout<<ch;
ch=cin.get();

}

return 0;

}
sir, in video it is said that if we run this program then whatever we will write in single lie gets printed… and what ever we write in the next line gets discarded… but sir when i run this program in sublime text 3 as soon as i press enter it shows me the output… so how to shift on next line so that i can check if this program i completely fine or not??

@Sheenagoyal21
You could try running your code on an Online IDE like ide.codingblocks.com or set up your very own Sublime Text 3 like that which would be useful for Competitive programming. Refer to this to do that - https://blog.codingblocks.com/2016/setting-up-sublime-text-for-competitive-coding/.

If you just wish to put a new line character in your command prompt without passing it as input , use the alt code.
Hold ALT and press 010 i.e. Alt + 010.
This commands the computer to input the character which has ASCII value = 010 which happens to be the new line character.
Make sure to type 010 and not just 10.
Hope this will 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.