If you still want to write/compile code on device, there are a few Android-based compilers...or environments that include compiler packages...out there but I'm guessing you'd need a fairly beefy tablet.
For compiling, I use the KBOX environment, on a NookHD. There are several downloadable packages for it...including GCC 4.7, GCC 4.8 and nano packages. NOTE: I'm a beginner so I've only compiled very small programs with it; I wouldn't know how larger, more complex code would compile. There are other apps...both in the Play store and online...but I can't speak to them because I haven't used them.
For writing code, I use DroidEdit. Nano in the KBOX environment works in a pinch...but there are some screen draw bugs due to Androids minimal bionic library that could get annoying if you're writing lots of code.