Arduino Questions and Answers – Mathematical Functions

This set of Arduino Questions and Answers for Experienced people focuses on “Mathematical Functions”.

1. What is the math function to find out the minimum of 2 numbers?
a) The min() function
b) The minimum_number() function
c) The m() function
d) The minimumOf() function
View Answer

Answer: a
Explanation: The min() function takes in 2 arguments and outputs only 1 number. This function finds out the minimum of the 2 numbers that are entered as arguments to the function. This function is essential in sorting techniques.

2. What is the math function to find out the maximum of 2 numbers?
a) The maximumOf() function
b) The maximum_number() function
c) The max() function
d) The m() function
View Answer

Answer: c
Explanation: The max() function takes in 2 arguments and outputs only 1 number. This function finds out the maximum of the 2 numbers that are entered as arguments to the function. This function is essential in sorting techniques.

3. What is the maximum number of arguments for the constrain() function?
a) 1
b) 2
c) 3
d) 4
View Answer

Answer: c
Explanation: The constrain() function is used to restrict the output from going below or above a certain minimum or maximum number respectively. It takes three arguments; the number to be contrained, the minimum value, and the maximum value.
advertisement
advertisement

4. What is the maximum number of arguments for the map() function?
a) 1
b) 3
c) 5
d) 7
View Answer

Answer: c
Explanation: The map() function is used to map a number from one number set to another number set. It takes three arguments; the number to be mapped, the lowest number of the source number set, the highest number of the source number set, the lowest number of the destination number set, the highest number of the destination number set.

5. What is the purpose of the pow(x,y) function?
a) To find xy
b) To find yx
c) To find ex
d) To find 10y
View Answer

Answer: a
Explanation: The pow() function is used to find the value of a number raised to another number. It takes two arguments; the base, and the exponent. The input datatypes are of the float datatype and the output is of the double datatype.
Note: Join free Sanfoundry classes at Telegram or Youtube

6. What is the use of the sqrt() function?
a) To find the square of a number
b) To find the square root of a number
c) To find the cube root of a number
d) To find the cube of a number
View Answer

Answer: b
Explanation: The sqrt() function is used to find the square root of a number. It takes one argument; the number whose square root is to be found out. This function can accept any number-based datatypes and gives the output in the double datatype.

7. What is the use of the sq() function?
a) To find the square root of a number
b) To find the square of a number
c) To find the cube of a number
d) To find the cube root of a number
View Answer

Answer: b
Explanation: The sq() function is used to find the square of a number. It takes one argument; the number whose square is to be found out. This function can accept any number-based datatypes and gives the output in the double datatype.
advertisement

8. What is the use of the cos() function?
a) To find the cosine of a number
b) To find the sine of a number
c) To find the tan of a number
d) To find the inverse cosine of a number
View Answer

Answer: a
Explanation: The cos() function is used to find the cosine of a number. It takes one argument; the number whose cosine is to be found out. This number is to be entered in the radian format and not the degree format. This function can accept any number-based datatypes and gives the output in the double datatype.

9. What is the use of the sin() function?
a) To find the sine of a number
b) To find the cosine of a number
c) To find the tan of a number
d) To find the inverse tan of a number
View Answer

Answer: a
Explanation: The sin() function is used to find the sine of a number. It takes one argument; the number whose sine is to be found out. This number is to be entered in the radian format and not the degree format. This function can accept the float datatype and gives the output in the double datatype.
advertisement

10. What is the use of the tan() function?
a) To find the sine of a number
b) To find the cosine of a number
c) To find the tan of a number
d) To find the inverse tan of a number
View Answer

Answer: c
Explanation: The tan() function is used to find the tangent of an angle. It takes one argument; the angle whose tangent is to be found out. This number is to be entered in the radian format and not the degree format. This function can accept the float datatype and gives the output in the double datatype.

Sanfoundry Global Education & Learning Series – Arduino.

To practice all areas of Arduino for Experienced people, here is complete set of 1000+ Multiple Choice Questions and Answers.

If you find a mistake in question / option / answer, kindly take a screenshot and email to [email protected]

advertisement
advertisement
Subscribe to our Newsletters (Subject-wise). Participate in the Sanfoundry Certification contest to get free Certificate of Merit. Join our social networks below and stay updated with latest contests, videos, internships and jobs!

Youtube | Telegram | LinkedIn | Instagram | Facebook | Twitter | Pinterest
Manish Bhojasia - Founder & CTO at Sanfoundry
Manish Bhojasia, a technology veteran with 20+ years @ Cisco & Wipro, is Founder and CTO at Sanfoundry. He lives in Bangalore, and focuses on development of Linux Kernel, SAN Technologies, Advanced C, Data Structures & Alogrithms. Stay connected with him at LinkedIn.

Subscribe to his free Masterclasses at Youtube & discussions at Telegram SanfoundryClasses.