Q1medium
Trace the result of this Java-style math logic:
try:
int x = 10 / 0
catch (ArithmeticException e):
x = 0
print(x)
Topic-wise practice questions for Programming (C++ / Java / Python). Test your knowledge, check solutions on demand, and pace your preparation.
try:
int x = 10 / 0
catch (ArithmeticException e):
x = 0
print(x)
function check():
try:
print("A")
return 1
catch:
print("B")
finally:
print("C")
try { ... }
catch (std::exception& e) { ... }
catch (std::runtime_error& e) { ... }
java.lang.Error)?