Microsoft Exam Questions

Which line of code should you insert at line CE43?

You need to ascertain whether the device that the app is running on has a compass.
Which line of code should you insert at line CE43?

A.
while(Windows.Devices.Sensors == Compass)

B.
if (Compass.GetDefault() != null)

C.
if (Compass.GetDefault() == Compass.FirstOrDefault)

D.
if(Compass.GetCurrentReading() != null)