I am not sure if your use of the wording "when the device is switched on" is important.
Using an accelerometer device in this sort of context, what you are really doing with it, is measuring
the direction of gravity, which you can assume is "down". Doing this depends on an assumption that
the device is not also being accelerated here and there all over the place. If you put this device inside
a football and started throwing it about, your arduino would have logical difficulties to distinguish
between the accelerations of the throwing and kicking, and the acceleration of gravity.
It is easy to calculate the angle of a device, relative to down, right now. Once you introduce
the complication of "when the device is switched on", you introduce some timing difficulties with
determining that intial position, the order in which the different integrated circuits get powered on,
the time for the first "stable" calculation to be completed, and so on.