variable declaration, its scope and different types of error