Except for a few oddball exceptions, the source code for a programming language is just a text file. So, yes, you can write it using notepad. In theory. BUT YOU DON'T WANT TO!!!!
Programming can be reasonably difficult. It's not like writing a quick email, or bashing out an anwer here. Here I can type anwer and you know I mean answer. You can't get away with that when programming. Every typo is an error you have to go back and fix.
Notepad doesn't have a spell checker, much less a code syntax checker, so it isn't going to help you out at all.
Indentation of code is really important for making it readable. Code that isn't indented properly is a nightmare to read and work with. Notepad doesn't have any tools that help with that.
After you key in your code, you need to compile and run it (or, in some languages, just run it). Notepad doesn't know how to do that.
I could go on and on (hum, I think I have already), but the point is, a simple text editor doesn't give you all the tools you need. If you're going to build a set of cabinets, do you want a fully stocked woodworking workshop, or do you want a hammer and screwdriver? Notepad is a hammer and screwdriver.
You want an IDE. Or you at least want Notepad++ (although only for smaller sized stuff). A good IDE will give you all the tools you need to do the job. They are MUCH more complicated than notepad. It will take you longer to learn how to use them. But you HAVE to invest the time in learning how to use the tools, or your cabinets will end up looking like they were built by somebody with a hammer and screwdriver. Kind of like some of the really bad web pages you find on the net.