I'm assuming that you eventually want to be able to execute the program on-device; I can't post a comment to ask this as I don't have enough reputation yet, so feel free to post a comment to this answer if this is not the case.
Depending on how complex of a program you wish to write, there are a few methods you can try. If you want to write code that is several hundred lines or more, then you can add the NDK to your development environment if you have one, as others have mentioned.
If you want to write "hello world" or something equally simple, you can also code on-device...assuming you have an Android based device. There are several development environment options available both on and off the Google Play store.
Hope this helps.