I would say functional and straightforward
Answer:
c = 1 # global variable
jhjl jh
def add():
c = 1 # global variable
def add():
print(c)
add()
c = c + 2 # increment c by 2
print(c)
add()
Explanation:
Answer:
The answer to the given question can be given as:
The value of *iptr is 7. and the value of iptr is dynamic.
Explanation:
In the c++ code, it is defined that x is an integer variable that assigns a value which is 7. Then we define a pointer variable that is *iptr. This variable holds an address of the x variable. When we print the value of the iptr variable. if we use the expression *iptr to print value of the pointer variable by cout that is used in c++ for pint values. so the value of the iptr is 7. If we use the expression iptr sent to cout so we show the address of the variable x. In the pointer, it manages the addresses of dynamically allocated so the address of the variable is changed on execution time.
Answer:
Example 1:
def function(num):
print(num*2)
Example 2:
function(5)
num = 2
function(num)
function(3-1)
Explanation:
Given:
See attachment for complete question
To start with Example (1)
def function(num):
print(num*2)
<em>Note that; the above code segment which doubles the parameter, num could have been any other code</em>
<em />
<em>In Example (1), the parameter is num</em>
For example (2):
We can call the function using:
#1. A value:
function(5)
<em>In #1, the argument is 5; a value</em>
#2. A Variable
num = 2
function(num)
<em>In #2, the argument is num; a variable</em>
#3. An Expression
function(3-1)
<em>In #3, the argument is 3-1; an expression</em>