in Technology by

What does the expression float a = 35 / 0 return?

a) 0

b) Not a Number

c) Infinity

d) Run time exception

1 Answer

0 votes
by

Answer: (c) Infinity

Explanation: In Java, whenever we divide any number (double, float, and long except integer) by zero, it results in infinity. According to the IEEE Standard for Floating-Point Arithmetic (IEEE 754), if we divide 1/0 will give positive infinity, -1/0 will give negative infinity, and 0/0 will give NaN. But on dividing an integer by zero, it throws a runtime exception, i.e., java.lang.ArithmeticException.

Hence, the correct answer is an option (c).

Related questions

0 votes
    If an expression contains double, int, float, long, then the whole expression will be promoted into which of ... questions and answers pdf, java interview questions for beginners...
asked Oct 28, 2021 in Education by JackTerrance
0 votes
0 votes
    Complete the equations for the following nuclear processes: (a) . 35 17 C l + . 0 1 n → ... + . 4 2 H e . (b) . ... u ( α , β − ) ... . Select the correct answer from above options...
asked Jan 2, 2022 in Education by JackTerrance
0 votes
    A and B are two events such that P (A) = 0.54, P (B) = 0.69 and P (A ∩ B) = 0.35. Find (i) P (A ∪ B) ... (A ∩ bar B) (iv) P(B ∩ bar A) Select the correct answer from above options...
asked Nov 22, 2021 in Education by JackTerrance
0 votes
    If A and B are mutually exclusive events, P (A) = 0.35 and P (B) = 0.45, find (a) P (A′) (b) P (B′) (c) P ... P (A ∩ B′) (f) P (A′∩ B′) Select the correct answer from above options...
asked Nov 21, 2021 in Education by JackTerrance
0 votes
0 votes
0 votes
    Please help me in understanding the following C Output: #include int main() { float x = 4.0; ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Feb 9, 2022 in Education by JackTerrance
0 votes
    Please help me in understanding the following C Output: #include int main() { float x = 4.0; ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Feb 7, 2022 in Education by JackTerrance
0 votes
    Please help me in understanding the following C Output: #include int main() { float x = 4.0; ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Feb 7, 2022 in Education by JackTerrance
0 votes
    Please help me in understanding the following C Output: #include int main() { float x = 4.0; ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Feb 7, 2022 in Education by JackTerrance
0 votes
    Please help me in understanding the following C Output: #include int main() { float x = 4.0; ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Feb 5, 2022 in Education by JackTerrance
0 votes
    Please help me in understanding the following C Output: #include int main() { float x = 4.0; ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Feb 5, 2022 in Education by JackTerrance
0 votes
    Please help me in understanding the following C Output: #include int main() { float x = 4.0; ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Feb 5, 2022 in Education by JackTerrance
...