+ 2

C++ query ,help me

#include <iostream> using namespace std; int main() { string smiley = " @@@@ @@@@\n" " @@@@@@ @@@@@@\n" " @@@@@@ @@@@@@\n" " @@@@ @@@@\n" "\n" "\n" "\n" " @ @\n" " @@ @@\n" " @@@ @@@\n" "@@@@@ @@@@@\n" " @@@@@@@@@@@@@@@@\n"; cout << smiley; return 0; } I'm unable to solve it. 😭😭 The output will full smiley face.

6th Jun 2024, 5:35 PM
Mahima
Mahima - avatar
3 odpowiedzi
+ 2
Hi. Hope that you are doing fine. Your C++ code is almost correct, but there are some minor adjustments needed for proper alignment of the smiley face. Here is the corrected code: #include <iostream> using namespace std; int main() { string smiley = " @@@@ @@@@\n" " @@@@@@ @@@@@@\n" " @@@@@@ @@@@@@\n" " @@@@ @@@@\n" "\n" "\n" "\n" " @@@@ @@@@\n" " @@@@@@ @@@@@@\n" " @@@@@@@@ @@@@@@@@\n" "@@@@@@@@@@ @@@@@@@@@@\n" " @@@@@@@@@@@@@@@@@@\n"; cout << smiley; return 0; }
6th Jun 2024, 8:55 PM
Muhammad Usama Zain
+ 1
as i remember this was a question in a course. You not have to edit the face itself. I think it just ask you to print it , nothing more. So just reset the code and only print it like you have at the end.
7th Jun 2024, 1:51 PM
john ds
john ds - avatar
0
it might be cuz your device screen is not perfect for running the code, try to make it smaller which will be suitable for your device
8th Jun 2024, 5:26 AM
Alhaaz
Alhaaz - avatar