Answer:
B. Run-time Error
Explanation:
You can't divide by zero in math because it could be divided by itself an infinite number of time, which is not possible.
A. Syntax error is just the 'grammar' of the code. An example could be forgetting to add a semicolon at the end of your code in C. Another example is forgetting to close brackets or quotes
<em>printf("inclomplete string </em>WRONG, will give syntax error
B. Run-time error is an error that occurs while the program is running. This might happen because of many reasons, one of which is calculation errors such as dividing by 0.
C. I don't know what an Undetected Error is. Never hear of it.
D. Logic error is an error when a condition is not logically correct. This could be because you used the wrong type of operator.
if(a = b) WRONG, will give logic error
if(a == b) CORRECT
Answer:
Hello the options to your question is missing here are the options
answer : 7
Explanation:
The value of the num_colors variable is 7 and this because you have to neglect the fact that there is no termination symbol at the end of the assignment operation in the code.
But when we consider the none existence of a termination symbol at the end of the assignment operation in the code, the code will generate a syntax error instead of a value.
Stanley Kubrick & Arthur C. Clarke :)
Code:
def interest():
interest_rate = 0.06
investment = input(int('Investment: '))
yield = 0
year = 0
while (yield < investment):
year += 1
yield = investment * interest_rate
print (year)
NOTE: i wrote this code assuming that the investment for the next year is the same as the first year and so forth