In C ,what is the use of static storage class when an external variable can serve its purpose at the same cost ie. both occupy storage space in the data segment of the execu
Difference between local and global first and foremost is the scope: you can access local variables only from within the block they're defined in, while global variables can be accessed from anywhere. Consequently, you can only have one variable with a given name in global scope, but you can have multiple local static variables in different functions.
As with static global variables versus extern variables: yes, static global variables are local to the translation unit (i.e. the .c source file they're defined in).
So the main concern here is the notion of scope, and the storage comes naturally from there.