Sad Face

Hi I am required to print a sad face using cout and I have no idea how to do so please help me
If you can do the hello-world program, you can do this program too.
Do you mean this:

If so, you just type Alt+9786. Or, for easiness, just copy the smily face above (took me 10 tries to type that, so just copy and paste it into your code, like this:
std::cout<<"☺\n";

Or this:
:)
If it's the latter, then just do this in the code:
std::cout<<":)\n";

There is a whole bunch of symbols with the Alt+[number] keys. Here is a good source:
http://www.wikihow.com/Type-Symbols-Using-the-ALT-Key

EDIT: Fixed the 2nd code tag
Last edited on
Hi I meant like for the smiley face I used the code
cout<<"\x01";

but for sad/frowning face I am unable to discover the code therefore I would like to know what is the code use ?
Hi I used the code in the webpage however it prints a question mark symbol

cout<<"\u2639";
There is no frowning face for the default code page on PCs.

I would really be surprised if your assignment was just to discover how to print a single character.

I think it much more likely your professor wants you to do some ASCII art with asterisks or something.
1
2
3
4
5
6
#include <iostream>
using namespace std;
int main()
{
  cout << "\t☺";
}
Hi guys I tired all the suggestion given however it only prints a question mark symbol.
Did you read Duoas's response? What is your actual assignment?
closed account (28poGNh0)
What about this one ?

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
# include <iostream>
using namespace std;

int main()
{
    cout << "       a$$$$$$$$$$a" << endl;
    cout << "     a$$$$$$$$$$$$$$a" << endl;
    cout << "   a$$$$$$$$$$$$$$$$$$a" << endl;
    cout << "  a$$$$$$$$$$$$$$$$$$$$a" << endl;
    cout << " a$$$$$   $$$$$$   $$$$$a" << endl;
    cout << "a$$$$$     $$$$     $$$$$a" << endl;
    cout << "a$$$$$$$ $$$$$$$$$$$$$$$$a" << endl;
    cout << "a$$$$$$$ $$$$$$$$$$$$$$$$a" << endl;
    cout << "a$$$$$$$$$$$$$$$$$$$$$$$$a" << endl;
    cout << " a$$$$$$          $$$$$$a" << endl;
    cout << "  a$$$$  $$$$$$$$  $$$$a" << endl;
    cout << "   a$$ $$$$$$$$$$$$ $$a" << endl;
    cout << "     a$$$$$$$$$$$$$$a" << endl;
    cout << "       a$$$$$$$$$$a" << endl;

    cout << endl << "By Techno01 hope you dont like it" << endl;

    return 0;
}

@ Techno01: Nice but it's not really "sad". More like... Horrifying. 8^O
closed account (28poGNh0)
Dont worry @cnoeval ,he will be soon ,I have couple ideas :

break his legs ,stole his bike

BIG PS : Notice that he's crying ,that what I call it art of work
Last edited on
Topic archived. No new replies allowed.