Answer:
The correct answer is: <u>A. it determines the orientation of the device</u>
Explanation:
An accelerometer is a sensor in mobile phone devices that is used to detect the orientation of the phone and then change the orientation of the content displayed on the mobile screen to adjust accordingly.
So the correct answer is:
<u>A. it determines the orientation of the device</u>
Answer:
The answer is given in the attachment
Explanation:
Answer:
Following are the program to this question:
#include <stdio.h>//using the header file
int main()//main method
{
int y;//defining integer variable y
printf("Enter year value:");//print message
scanf("%d", &y);//use input method for input year value
if (y>= 2101)//defining if block that checks year greater then 2101
printf("Distant future");//print message
else if (y>= 2001)//defining else if block that checks year greater then 2001
printf("21st century"); //print message
else if (y>= 1901)//defining else if block that checks year greater then 1901
printf("20th century");//print message
else //defining else block
printf("Long ago");//print message
return 0;
}
Output:
Enter year value:1998
20th century
Explanation:
In the given C language code, inside the main method, an integer variable "y" is defined, which allows the user to input the year value, and use the multiple conditions to check the given value and print message when the condition is matched.
- Inside the "if" condition block, it checks the "y" variable value is greater and equal to 2101. so, it will print "Distant future", otherwise go to the next condition.
- In this, if "y" value is greater than equal to "2001", it will print the message "21st century", otherwise go to the next condition.
- In this, If the value of "y" is greater than equal to "1901", it will print the message "20th century", and if all the above condition is not true, then it will go to the else block, and it will print "Long ago" as the message.
Answer:
Option A is the correct answer for the above question.
Explanation:
The Index Out Of Range exception is a type of Run exception which is generated on run time. It means when any user executes the software or program, then that program gives some error on the execution time by some coding problem or some value problem.
So this type of exception can be handle by the Catch block which is also stated by the option A. Hence A is the correct answer but the other is not because:-
- Option B states that this exception is generated by the catch block which is not correct.
- Option C states that the catch block passes the exception which is also not the correct.
- Option D states that the exception is passed for the operating system, but it is passed to the catch block only.