We have to give \n in single quotes can’t we use double quotes here which we have used for printing hello everyone
Query related to basic c++ code and quotes related
PLEASE REPLY TO THIS POST
Hello,
There is constraints in using single or double quotes with \n.
You can use them interchangeably as shown in the below
#include
using namespace std;
int main() {
cout<<“Hello”;
cout<<’\n’;
cout<<“World”;
cout<<"\n";
}
Output:
Hello
World
Hope, this would 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.