QUESTION 2 Assuming int j = 4, int k = 8; evaluate the following expressions. (j
ID: 3879722 • Letter: Q
Question
QUESTION 2
Assuming int j = 4, int k = 8; evaluate the following expressions. (j - k) * ( j + k )
QUESTION 3
Assuming int j = 4, int k = 8; evaluate the following expressions. j * (3 + k)
QUESTION 4
Given the function heading: int atoi(string s) Is atoi("-10") a valid function call?
True
False
1
QUESTION 5
Assuming int j = 4, int k = 8; evaluate the following expressions. k % (j - 2)
QUESTION 6
Assuming int j = 4, int k = 8; evaluate the following expressions. k % j
QUESTION 7
Given the function heading: int atoi(string s) Is atoi(81) a valid function call?
True
False
QUESTION 8
Given the function heading: int atoi(string s) What is the return type?
QUESTION 9
Assuming int j = 4, int k = 8; evaluate the following expressions. j % k
QUESTION 10
Assuming int j = 4, int k = 8; evaluate the following expressions. j / k
Explanation / Answer
QUESTION 2
Assuming int j = 4, int k = 8; evaluate the following expressions. (j - k) * ( j + k )
The Value is (4-8)*(4+8)
=-4*12
=-48
QUESTION 3
Assuming int j = 4, int k = 8; evaluate the following expressions. j * (3 + k)
The Value is 4*(3+11)
=56
QUESTION 4
Given the function heading: int atoi(string s) Is atoi("-10") a valid function call?
True
Since it will execute the value irrespective of the value passed
QUESTION 5
Assuming int j = 4, int k = 8; evaluate the following expressions. k % (j - 2)
The value is 8%(4-2)
The value is 0.
Since % will give remainder.
QUESTION 6
Assuming int j = 4, int k = 8; evaluate the following expressions. k % j
The value is 8%4.
That is 0 Since remainder is 0.
QUESTION 7
Given the function heading: int atoi(string s) Is atoi(81) a valid function call?
False
Since it will take string value passed
QUESTION 8
Given the function heading: int atoi(string s) What is the return type?
Integer is the return type since int function() means int is return
QUESTION 9
Assuming int j = 4, int k = 8; evaluate the following expressions. j % k
The value is 4 since remainder is 4.
QUESTION 10
Assuming int j = 4, int k = 8; evaluate the following expressions. j / k
The value is 0, Since quotient is 0.