From the docs
The version pragma is used as follows:
pragma solidity ^0.4.0;
Such a source file will not compile with a compiler earlier than version 0.4.0 and it will also not work on a compiler starting from version 0.5.0 (this second condition is added by using ^).
Then what happens if we have two files: A.sol and B.sol where A.sol is declaring pragma ^0.4.15 and at the same time imports B.sol which declares pragma ^0.4.0? How the compiler manages this mismatch?