Mark the following as valid or invalid function headings: int(int a, int b) Vali
ID: 3879818 • Letter: M
Question
Mark the following as valid or invalid function headings: int(int a, int b)
Valid
Invalid
QUESTION 2
Mark the following as valid or invalid function headings: string c(sting a)
Invalid
Valid
QUESTION 3
Evaluate: pow(10.0,2.0)
QUESTION 4
Evaluate the following expressions. If required, use a decimal point to distinguish integer and floating-point values: 1.0 + 2.0 - 3.0 * 4.0
QUESTION 5
Mark the following as valid or invalid function headings: double g( )
Valid
Invalid
QUESTION 6
Use the object initializations to evaluate the expressions that follow:
double x = 5.0; Evaluate: sqrt(x - 1.0)
QUESTION 7
Use the object initializations to evaluate the expressions that follow (upto 3 decimal places):
double x = 5.0; double y = 7.5; Evaluate: sqrt(y - x + 2.0)
QUESTION 8
Use the object initializations to evaluate the expressions that follow:
double x = 5.0; double y = 7.5; Evaluate: fabs(y - x)
Valid
Invalid
Explanation / Answer
Question 1
It is invalid as the function name is not provided.
Question 2
It is valid function heading as function prototype is there function name is there and then parameter list is there.
Question 3-
it is 10^2 = 100
Question 4-
the annswer will be
1.0+2.0-12.0 which will be equal to -0.9 it is because the * as more priority then +,-
Question 5-
it is a valid function heading without a parameter list.
Question 6-
it will be 2 because sqrt(5-1)=> sqrt(4) which is 2.
Question 7-
it will be 2.121 as sqrt(7.5-5.0+2.0)=> sqrt(4.5)= 2.121
Question 8-
fabs(7.5-5.0)=it will be 2.5 as fabs calculate the absolute value.
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.