How to change the content type for files in SharePoint

In this article we will be seeing how to change a batch of files in a document library from one content type to another using C#.

I have batch of files in a document library which belongs to the "Document "content type. I want to change the content type from "Document" to "_CustomContentType (which is a custom content type).