We are given the general solution:
\[
y=a\sin x+b\cos x.
\]
Here, \(a\) and \(b\) are arbitrary constants.
In a differential equation, the number of arbitrary constants in the general solution is equal to the order of the differential equation.
Here there are two arbitrary constants:
\[
a \quad \text{and} \quad b.
\]
Therefore, the order of the differential equation is:
\[
2.
\]
We can also verify by differentiating.
Given:
\[
y=a\sin x+b\cos x.
\]
Differentiate once:
\[
y'=a\cos x-b\sin x.
\]
Differentiate again:
\[
y''=-a\sin x-b\cos x.
\]
But,
\[
a\sin x+b\cos x=y.
\]
So,
\[
y''=-y.
\]
Therefore,
\[
y''+y=0.
\]
This differential equation contains the second derivative \(y''\), so its order is \(2\).
Hence, the correct answer is:
\[
2.
\]