Chapter 4_ Operators in Java _ Solutions for Class 10 ICSE Logix Kips Computer Applications with BlueJ Java _ KnowledgeBoat
Chapter 4_ Operators in Java _ Solutions for Class 10 ICSE Logix Kips Computer Applications with BlueJ Java _ KnowledgeBoat
Home / Class 10 - Logix Kips ICSE Computer Applications with BlueJ / Operators in Java
CONTENTS
Chapter 4
Search by lesson title
Operators in Java Multiple Choice Questions
Chapter 3
Values and Data Types
Kingston Thumb Drives
Chapter 4
Operators in Java
Store your data on the go without needing internet
Chapter 5 connection.
User-Defined Methods
Chapter 6
Input in Java
Chapter 8
Conditional Constructs in Java
Multiple Choice Questions
Chapter 9
Iterative Constructs in Java
Question 1
Chapter 10
Nested for loops
If a = 8 and b = 4, the value of a %= b is ...........
Chapter 11
Constructors
1. 2
2. 0 ✓
3. 4
4. 8
Explanation
a %= b
⇒a=a%b
⇒a=8%4 [Putting values of a & b]
⇒a=0
Question 2
1. A unary operator ✓
2. A binary operator
3. A ternary operator
4. None of these
Question 3
1. AND
https://www.knowledgeboat.com/learn/class-10-logix-icse-computer-applications-java-bluej/solutions/9Ev4Q/java-operators 1/17
5/20/24, 1:31 PM Chapter 4: Operators in Java | Solutions for Class 10 ICSE Logix Kips Computer Applications with BlueJ Java | KnowledgeBoat
2. %
3. ==
4. ! ✓
Explanation
Question 4
1. <=
2. !== ✓
3. !=
4. ==
Question 5
1. i++
2. i += 1
3. ++i
4. All of these ✓
Explanation
Question 6
1. sum = 12
2. sum = 13
3. sum = 14 ✓
4. sum = 15
Explanation
sum = ++x + 8
⇒ sum = 6 + 8
⇒ sum = 14
++x will first increment the value of x from 5 to 6 and then use
this incremented value in the expression.
Question 7
1. x=1, y=1
https://www.knowledgeboat.com/learn/class-10-logix-icse-computer-applications-java-bluej/solutions/9Ev4Q/java-operators 2/17
5/20/24, 1:31 PM Chapter 4: Operators in Java | Solutions for Class 10 ICSE Logix Kips Computer Applications with BlueJ Java | KnowledgeBoat
2. x=0, y=0 ✓
3. x=1, y=0
4. x=0, y=1
Explanation
Question 8
1. 0
2. 1
3. false ✓
4. true
Explanation
1>0 is true and 1<0 is false so the condition becomes true &&
false . As && return true only when both of its operands are true
Question 9
1. 0
2. 1
3. false
4. true ✓
Explanation
Question 10
1. 0
2. 1 ✓
3. false
4. true
Explanation
1==1 is true so the expression just after the question mark (which
Question 11
https://www.knowledgeboat.com/learn/class-10-logix-icse-computer-applications-java-bluej/solutions/9Ev4Q/java-operators 3/17
5/20/24, 1:31 PM Chapter 4: Operators in Java | Solutions for Class 10 ICSE Logix Kips Computer Applications with BlueJ Java | KnowledgeBoat
1. 4
2. 3
3. 2
4. 1 ✓
Explanation
Question 12
float x = 8.25F;
int y;
y = (int) x;
1. x= 8.25, y = 8 ✓
2. x = 8.0, y = 8.0
3. x = 8, y = 8.25
4. x = 8, y = 8
Explanation
When float value is casted to an int, the digits after the decimal
sign are discarded so y is assigned a value of 8.
Question 13
1. 4 ✓
2. 3
3. 0
4. 1
Explanation
Question 14
1. six 33 ✓
2. six 6
3. 33 six
4. 6 six
https://www.knowledgeboat.com/learn/class-10-logix-icse-computer-applications-java-bluej/solutions/9Ev4Q/java-operators 4/17
5/20/24, 1:31 PM Chapter 4: Operators in Java | Solutions for Class 10 ICSE Logix Kips Computer Applications with BlueJ Java | KnowledgeBoat
Explanation
Question 15
1. 6
2. 8
3. 4 ✓
4. None of these
Explanation
4+8%2
⇒4+0
⇒4
Question 16
Question 1
Question 2
Question 3
Question 4
Question 5
https://www.knowledgeboat.com/learn/class-10-logix-icse-computer-applications-java-bluej/solutions/9Ev4Q/java-operators 5/17
5/20/24, 1:31 PM Chapter 4: Operators in Java | Solutions for Class 10 ICSE Logix Kips Computer Applications with BlueJ Java | KnowledgeBoat
Question 6
Question 7
Question 8
Question 9
Question 10
Question 11
Question 12
Question 13
Question 14
Question 1
Answer
int quotient = y / x;
int remainder = y % x;
https://www.knowledgeboat.com/learn/class-10-logix-icse-computer-applications-java-bluej/solutions/9Ev4Q/java-operators 6/17
5/20/24, 1:31 PM Chapter 4: Operators in Java | Solutions for Class 10 ICSE Logix Kips Computer Applications with BlueJ Java | KnowledgeBoat
Question 2
Answer
float pi = 3.142f;
Question 3
Answer
Operator Symbol
Logical OR ||
Logical NOT !
Question 4
Answer
variable = expression;
For example,
totalMarks = 780;
Question 5
Answer
https://www.knowledgeboat.com/learn/class-10-logix-icse-computer-applications-java-bluej/solutions/9Ev4Q/java-operators 7/17
5/20/24, 1:31 PM Chapter 4: Operators in Java | Solutions for Class 10 ICSE Logix Kips Computer Applications with BlueJ Java | KnowledgeBoat
Question 6
Answer
Question 7
Answer
Question 8
Answer
= ==
Question 9
Answer
a += a++ - ++b + a
⇒ a = a + (a++ - ++b + a)
⇒ a = 5 + (5 - 10 + 6)
⇒a=5+1
⇒a=6
Question 10
https://www.knowledgeboat.com/learn/class-10-logix-icse-computer-applications-java-bluej/solutions/9Ev4Q/java-operators 8/17
5/20/24, 1:31 PM Chapter 4: Operators in Java | Solutions for Class 10 ICSE Logix Kips Computer Applications with BlueJ Java | KnowledgeBoat
Answer
Example:
Example:
int a = 99;
int a = 99;
int b = a++;
int b = ++a;
After the execution of these two
After the execution of these
statements, a will have the
two statements, both a and
value of 100 and b will have the
b will have the value of 100.
value of 99.
Answer
Example:
Example:
int a = 100;
int a = 100;
int b = a--;
int b = --a;
After the execution of these two
After the execution of these
statements, a will have the value
two statements, both a and
of 99 and b will have the value
b will have the value of 99.
of 100.
Answer
Answer
https://www.knowledgeboat.com/learn/class-10-logix-icse-computer-applications-java-bluej/solutions/9Ev4Q/java-operators 9/17
5/20/24, 1:31 PM Chapter 4: Operators in Java | Solutions for Class 10 ICSE Logix Kips Computer Applications with BlueJ Java | KnowledgeBoat
e. / and % operator
Answer
/ %
Question 11
Answer
i. m -= n
⇒m=m-n
⇒m=5-2
⇒m=3
ii. n = m + m/n
⇒ n = 5 + 5/2
⇒n=5+2
⇒n=7
Question 12
Answer
x -= x++ - ++y
⇒ x = x - (x++ - ++y)
⇒ x = 3 - (3 - 8)
⇒ x = 3 - (-5)
⇒x=3+5
⇒x=8
Question 13
https://www.knowledgeboat.com/learn/class-10-logix-icse-computer-applications-java-bluej/solutions/9Ev4Q/java-operators 10/17
5/20/24, 1:31 PM Chapter 4: Operators in Java | Solutions for Class 10 ICSE Logix Kips Computer Applications with BlueJ Java | KnowledgeBoat
Answer
i. 5 * ++x
⇒5*6
⇒ 30
ii. 5 * x++
⇒5*5
⇒ 25
Question 14
Answer
int a = 10;
float b = 25.5f, c;
c = a + b;
int a = 10;
double b = 25.5;
float c = (float)(a + b);
Question 15
Answer
Question 16
Answer
Question 17
https://www.knowledgeboat.com/learn/class-10-logix-icse-computer-applications-java-bluej/solutions/9Ev4Q/java-operators 11/17
5/20/24, 1:31 PM Chapter 4: Operators in Java | Solutions for Class 10 ICSE Logix Kips Computer Applications with BlueJ Java | KnowledgeBoat
Answer
Question 18
i. a - (b++) * (--c)
ii. a * (++b) %c
Answer
i. a - (b++) * (--c)
⇒2-3*2
⇒2-6
⇒ -4
ii. a * (++b) %c
⇒2*4%3
⇒8%3
⇒2
Question 19
i. (a + b)2 + b
Answer
Math.pow(a+b, 2) + b
ii. a2 + b2
Answer
a*a+b*b
iii. z = x3 + y3 + (xy) / 3
Answer
z = Math.pow(x, 3) + Math.pow(y, 3) + x * y / 3
iv. f = a2 + b2 / a2 - b2
Answer
f = (a * a + b * b) / (a * a - b * b)
v. z = ab + bc + ca / 3abc
https://www.knowledgeboat.com/learn/class-10-logix-icse-computer-applications-java-bluej/solutions/9Ev4Q/java-operators 12/17
5/20/24, 1:31 PM Chapter 4: Operators in Java | Solutions for Class 10 ICSE Logix Kips Computer Applications with BlueJ Java | KnowledgeBoat
Answer
z = (a * b + b * c + c * a) / (3 * a * b * c)
Answer
Answer
a = (0.05 - 2 * y * y * y) / (x - y)
viii. (a + b)n / √3 + b
Answer
Math.pow(a+b, n) / (Math.sqrt(3) + b)
ix. ax + by / ∛x + ∛y
Answer
Question 20
a. p /= q
b. p -= 1
c. p *= q + r
d. p -= q - r
Answer
a. p = p / q
b. p = p - 1
c. p = p * (q + r)
d. p = p - (q - r)
Question 21
Output
https://www.knowledgeboat.com/learn/class-10-logix-icse-computer-applications-java-bluej/solutions/9Ev4Q/java-operators 13/17
5/20/24, 1:31 PM Chapter 4: Operators in Java | Solutions for Class 10 ICSE Logix Kips Computer Applications with BlueJ Java | KnowledgeBoat
Output1: 12
Output2: 3
Explanation
12.
In second println statement, the expression is "Output2: " + (a + b).
Due to brackets, (a + b) is evaluated first. As both operands are
integers so they are added giving the result as 3. After that,
"Output2: " + 3 is evaluated, resulting in "Output2: 3".
Question 22
Answer
Question 23
Answer
Question 24
Output
Output 1: 6
https://www.knowledgeboat.com/learn/class-10-logix-icse-computer-applications-java-bluej/solutions/9Ev4Q/java-operators 14/17
5/20/24, 1:31 PM Chapter 4: Operators in Java | Solutions for Class 10 ICSE Logix Kips Computer Applications with BlueJ Java | KnowledgeBoat
Output 2: 6
Explanation
Question 25
Output
Output 1: true
Output 2: true
Explanation
Question 26
Output
Output 1: false
Output 2: false
Explanation
https://www.knowledgeboat.com/learn/class-10-logix-icse-computer-applications-java-bluej/solutions/9Ev4Q/java-operators 15/17
5/20/24, 1:31 PM Chapter 4: Operators in Java | Solutions for Class 10 ICSE Logix Kips Computer Applications with BlueJ Java | KnowledgeBoat
Class - 6 Effective History & Civics Solutions Java Number Programs (ICSE Classes 9 / 10) Privacy Policy
Class - 6 APC Understanding Computers Solutions Java Number Programs (ISC Classes 11 / 12) Terms of Service
Class - 7 Concise Physics Selina Solutions Output Questions for Class 10 ICSE Computer Applications
Class - 7 Concise Chemistry Selina Solutions Algorithms & Flowcharts for ICSE Computers
Class - 7 Dalal Simplified Middle School Chemistry Solutions ICSE Class 8 Computers Differentiate Between the Following
Class - 7 Living Science Biology Ratna Sagar Solutions Class - 8 NCERT Science Solutions
Class - 7 Around the World Geography Solutions Class - 9 NCERT Science Solutions
Class - 7 Veena Bhargava Geography Solutions Class - 9 NCERT Geography Contemporary India 1 Solutions
Class - 7 Effective History & Civics Solutions Class - 9 Sumita Arora Computer Code 165 Solutions
Class - 7 APC Understanding Computers Solutions Class - 9 Kips Cyber Beans Computer Code 165 Solutions
Class - 8 Dalal Simplified Middle School Chemistry Solutions Class - 10 NCERT Geography Contemporary India 2 Solutions
Class - 8 Concise Biology Selina Solutions Class - 10 NCERT History India & Contemporary World 2 Solutions
Class - 8 Living Science Biology Ratna Sagar Solutions Class - 10 Sumita Arora Computer Code 165 Solutions
Class - 8 Around the World Geography Solutions Class - 10 Kips Cyber Beans Computer Code 165 Solutions
Class - 8 Veena Bhargava Geography Solutions Class - 11 CBSE Sumita Arora Python Solutions
Class - 8 Effective History & Civics Solutions Class - 12 CBSE Sumita Arora Python Solutions
Class - 8 APC Understanding Computers Solutions Class - 12 CBSE Preeti Arora Python Solutions
Class - 8 Kips Logix Computers Solutions Class - 12 NCERT Computer Science Solutions
https://www.knowledgeboat.com/learn/class-10-logix-icse-computer-applications-java-bluej/solutions/9Ev4Q/java-operators 16/17
5/20/24, 1:31 PM Chapter 4: Operators in Java | Solutions for Class 10 ICSE Logix Kips Computer Applications with BlueJ Java | KnowledgeBoat
Class - 10 Concise Chemistry Selina Solutions
https://www.knowledgeboat.com/learn/class-10-logix-icse-computer-applications-java-bluej/solutions/9Ev4Q/java-operators 17/17