CBSE Class 12 Computer Science
Question 94 of 103
Working with Functions — Question 27
Back to all questions25*50!100!25
V = 25— initializes global variable V to 25.print(V, end = "*")— Prints the global variableV(25) followed by an asterisk without a newline.Fun("!")— Calls the functionFunwith the argument "!".- Inside function
Fun,V = 50initializes a local variableVwithin the function with the value 50. This variable is different from the global variableVthat has the value 25. print(V, end = Ch)— Prints the local variableV(50) followed by the character passed as an argument to the function, which is "!".V *= 2— Multiplies the local variableV(50) by 2, making it 100.print(V, end = Ch)— Prints the updated local variable V (100) followed by the character "!".- The function
Funreturns and the lineprint(V)is executed. It prints the global variableVwithout any newline character. The global variableVremains unchanged (25).