प्रोग्राम का आउटपुट दीजिए
Give the output of the program
<html>
<body>
<script>
var number=50;//global variable
function a(){
alert(number);
}
function b(){
alert(number);
}
a();
</script>
</body>
</html>
A)
B)
C)
D)
Explanation:
The given program defines a global variable number
with the value 50
, and two functions (a()
and b()
) that both alert the value of number
.
Since number
is a global variable, both functions a()
and b()
can access it. When a()
is called, it will alert 50
.
So, the correct output is:
(A) 50.