Answer
$M=7$
Work Step by Step
$I=1000 cm=10^3cm$
$S=10^{-4}cm $
$M=\log\frac{I}{S}$
Putting the values of $I$ and $S$ in the above formula
$M=\log\frac{10^3}{10^{-4}}$
$=\log(10^3\times 10^4)$
$=\log10^{3+4}$
$=\log10^7$
$=7\log10=7$