Postingan lainnya
Bantu memecahkan masalah
Kita tau kalo di c++ ada "\n" untuk enter,"\b" untuk backspace, dan lain lain. Bagaimana cara menampilkan "\" di console??
Jika menggunakanstd
std::cout<<"\";
Malah error
Tanggapan
bikin judul yang sesuai ya, baca aturan main
2 Jawaban:
<div>Coba ganti judulnya yaa, <br>Untuk menampilkan tanda \ di console, gunakan tanda backslash 2x,</div><pre>#include <iostream>
using namespace std;
int main() { cout<<"Hello World\n"; cout<<"BACK SLASH IN CONSOLE -> \ ";
return 0;
}</pre><div><br>Hasil kode programnya bisa di cek disini <a href="https://onlinegdb.com/3DUCTy8ee">https://onlinegdb.com/3DUCTy8ee</a><br><br>Referensi : <a href="https://stackoverflow.com/questions/1650981/how-do-you-output-the-symbol-using-cout">https://stackoverflow.com/questions/1650981/how-do-you-output-the-symbol-using-cout</a><br><br>Semoga membantu.</div>
<div>I see you have already gotthe right answer above. It's the only way to print the "" symbol</div>