If you don’t put effort into your question why should people put effort into answering your question?
There are 2 good ways to share code.
Copy and paste it and make sure to format the code
Share a link to a reply, gist, codepen, etc.
No, you should not. When in screenshots it’s impossible to debug your code.
One of the first things answerers do when examining a question’s code for errors is to try compiling (if necessary) and running the code to see what happens. Answerers may also copy part of the code to paste into search engines in order to learn about the types or algorithms being used, and to find other related material. When answerers are presented only an image of code, this process becomes much more difficult.
From I downvoted because
Include what you have tried to fix the problem. This is part of the first part of putting effort into your question. And it will save time for people that answer since they won’t need to go through the stuff you have already tried.
Your title should be short but detailed. For example, you should not write:
You should write
Error when trying to compare a string to a number in a conditional