if (x > 10)else if statement?else statement.if statement.if statement.else block is provided in a conditional structure?switch statement.&&) and OR (||).else statements.for loops.if-else statement in most programming languages?if condition { action } else { action }if (condition) { action } else { action }if condition: action else actionif condition then action else actionfor i in range(5): print(i)for loopwhile loopdo-while loopbreakexitreturnstopwhile loop?i = 0; while (i < 3): print(i); i += 1for loopwhile loopfor and whiledo-while loopfor loopwhile loopdo-while loopswitch loopwhile loop?True AND False?ORANDNOTXORANDORNOTXORFalse OR False?x is between 5 and 10 inclusive using logical operators?if x >= 5 and x <= 10if x < 5 and x > 10if x >= 5 or x <= 10if x == 5 and x == 10x > 5 or x == 10 when x = 7?!(a && b) evaluate to when a = true and b = false?try block in error handling?try block without a catch block?catch block handle?catch block?catch(Exception e)catch e as Exceptioncatch(Error)try(Error)catch block does not specify the type of error?raisethrowerrorexceptionfinally block?try-catch block?catch blocksfinally blockthrow inside the catch blocktry-catch structure improve code?| Qno | Answer |
|---|---|
| 1 | b) x is greater than 10 |
| 2 | b) It always follows an if statement. |
| 3 | c) The program continues to the next condition or block. |
| 4 | b) Using logical operators like AND (&&) and OR (` |
| 5 | b) if (condition) { action } else { action } |
| 6 | b) 0 1 2 3 4 |
| 7 | c) do-while loop |
| 8 | a) break |
| 9 | a) 0 1 2 |
| 10 | a) for loop |
| 11 | b) while loop |
| 12 | a) The program might run indefinitely unless stopped. |
| 13 | b) False |
| 14 | b) AND |
| 15 | c) NOT |
| 16 | b) False |
| 17 | a) if x >= 5 and x <= 10 |
| 18 | a) True |
| 19 | a) true |
| 20 | b) To test for errors during execution |
| 21 | a) The program will terminate immediately. |
| 22 | b) Runtime errors |
| 23 | a) catch(Exception e) |
| 24 | a) It will catch all errors. |
| 25 | b) throw |
| 26 | b) To execute code regardless of error occurrence |
| 27 | a) By returning a default value |
| 28 | a) Handling exceptions that might occur during file I/O |
| 29 | c) Ignoring errors entirely |
| 30 | b) It ensures errors are logged without interrupting program flow |