Question
3. Which statement is correct about binary operator? (A) In Java and C#, unary minus also causes the explicit conversion of short and byte operands
3. Which statement is correct about binary operator? (A) In Java and C#, unary minus also causes the explicit conversion of short and byte operands to int type. (B) In Perl, binary operators must be infix - appear between their operands (C) Operator precedence rules for the common imperative languages are based on those of mathematics. (D) Unary addition is called the identity operator and usually has no associated operation and however has effect on its operand.
6. Which statement is correct? (A) In Ruby, in the expression X ** Y ** Z, the left operator is evaluated first. (B) In Ada, the expression X ** Y ** Z is legal. (C) In Java, in the expression a - b + c, the right operator is evaluated first. (D) In APL, in the expression A B + C, the + is evaluated first, followed by X operator.
8. Given the code in C below: int a =10; int fun() { .... return 5; } void main() { a = a - fun(); } which statement is wrong? (A) If the function fun() changes the value of a, a side effect occurs. (B) If no side effect, the value of a in the main() will be 5. (C) If the function fun() changes the value of a to a = 4 and the function call is evalued first, the value of a in the main() will be -5. (D) (C) If the function fun() changes the value of a to a = 14 and the variable a is evalued first, the value of a in the main() will be 5.
11. Which statement is correct? (A) Type conversions implicitly requested by the programmer are referred to as casts. (B) In Ada, the exponentiation operator, **, can only take an integer type for the 1st operand and an float type for the 2nd operand (C) ML and F# always coerce operands in expressions. (D) In Java, operands of byte and short types are coerced to int whenever virtually any operator is applied to them.
12. Which statement is wrong? (A) A relational operator compares the values of its two operands. (B) A relational expression has two operands and one relational operator. (C) The value of a relational expression must be Boolean. (D) The syntax of the relational operators for equality and inequality differs among some programming languages.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started