Hi, this is not a general programming board nor a window programming board, you should ask in an appropriate forum.
Assuming you are working on windows (since you talk about exe), it can be done adding the icon.ico in the executable resources, it should work both for graphical and console applications. To be clear, here I'm talking about the icon you see when you look at your executable file, not the little icon in the corner of the window, when you run it.
Regards, XayC