Is there any shortcut for CodeBlocks to format the code?
probably not by default but you should be able to assign it there: Settings -> Editor -> Keyboard shortcuts -> Plugins -> Source code formatter (AStyle)
probably not by default but you should be able to assign it there: Settings -> Editor -> Keyboard shortcuts -> Plugins -> Source code formatter (AStyle)