0
New line
I have been trying to solve a problem on new line, requiring me to output C + + Instead of "C++" I have done it in so many ways but they seem not to be accepting my method. Can anyone help?
6 Answers
+ 5
Show us your code Oo"
+ 4
#include <iostream>
using namespace std;
int main() {
char w[] = "C++";
int ln = sizeof(w)-1;
for (int i=0; i<ln; i++) cout << w[i];
cout << endl << endl;
for (int i=0; i<ln; i++) cout << w[i] << endl;
return 0;
}
https://code.sololearn.com/c9l51nWJa6DB
Good Luck
0
Thanks a lot
0
This is actually to complex for my level
0
Check this page, yo ucan see there more ways to solve your problem
https://www.udacity.com/blog/2021/08/creating-a-new-line-in-cpp.html
0
The new line character is â\nâ or you can insert the endl manipulator