I want to have all folder name which is present in my library and the folder structure is like this:
Folder 1 Sub Folder 1.1 Sub Folder 1.1.1 Sub Folder 1.2 Folder 2 Sub Folder 2.1 Sub Folder 2.1.1 Folder 3
Any help will be appreciated.
I'll refer you to an existing answer: get all document from all folder and subfolder from document library sharepoint 2010
In short, you can do a simple CamlQuery against the list for all items with FSObjType (Lookup) value of "1" but ensure you include the Scope="Recursive" attribute as part of the element. Once you have the values returned, you can build up your structure based on the URL.
Hope this helps.