CBSE Class 11 Computer Science
Question 97 of 161
Flow of Control — Question 6
Back to all questions 6
Question Question 6
Find the errors in the code given below and correct the code:
if n == 0
print ("zero")
elif : n == 1
print ("one")
elif
n == 2:
print ("two")
else n == 3:
print ("three")Answer
The corrected code is below:
if n == 0 : #1st Error
print ("zero")
elif n == 1 : #2nd Error
print ("one")
elif n == 2: #3rd Error
print ("two")
elif n == 3: #4th Error
print ("three")