| preferred AP College board partner for AP classes
easy Solved by 9 students
Effect of Comments on Program Execution
< Prev
Next >

A student is debugging a program and finds this code segment:

x = 5
# x = x + 1
y = x * 2

Which of the following best describes the value of y after this code executes?

A

10, because the commented line is not executed

B

Error, because the comment interrupts the calculation

C

10 or 12, depending on the programming language

D

12, because all lines contribute to the calculation

Hint
Did You Know?
Explain Why
Explain All Answers
Check Answer
Show Correct Answer
Report Question

Question Leaderboard

Rank
User
Correct Count
Attempt Count
Time
Score
#1foevito.rw11 0m 00s 100
#2devanshs90511 0m 11s 89
#3emmalinecandersen11 0m 12s 88
#4jjacobs11 0m 21s 79
#5spiritgen0211 0m 27s 73
#6soniahalepota200512 0m 26s 64
#7garudvihaan13 4m 53s -213
Items per page:
10
1 – 7 of 7
No comments yet. Be the first to comment!

AI Tutor

How can I help?

APFIVE © 2020.
Email: [email protected]|Privacy Policy