CBSE Class 12 Computer Science
Question 12 of 44
Solved 2025 Sample Question Paper CBSE Class 12 Computer Science (083) — Question 12
Back to all questions12#15%
Reason —
- The variable
cis initially set to 10. - The function
add()is defined. Inside this function, theglobalkeyword is used to indicate that the variablecrefers to the global variable defined outside the function. - Inside
add(): Whenadd()is called:- The value of
c(which is 10) is accessed. - It is then incremented by 2, making
cequal to 12. - The new value of
c(12) is printed, followed by a#symbol.
- The value of
- After calling the function, the global
cis now 12. However, it is then explicitly set to 15. - Finally, the new value of
c(15) is printed, followed by a%symbol.