How can code be classified in a Thesis(Figure, Table, Listing, etc) I am writing a Thesis and there are sections that require me to add fragments of code or a complete code. Should this be classified as a figure, table,listing or snippet ?
Insert it as a listing. The convention is to print code verbatim in monospace font. If you're writing in LaTeX, the listings package exists for this purpose.