Got it! This site uses cookies. You consent to this by clicking on "Got it!" or by continuing to use this website.nbsp; Note: This appears on each machine/browser from which this site is accessed.
This page has some examples and questions involving assignment statements with procedures.
Note that all procedures use call by value for input values and call be reference for a value to be changed. The call then acts as a statement that is called for effect (to change the actual variable passed by reference).
2. Example 1
Here is the C code.
Here are the final values of the variables in the program (main).
h == 3
e == 7
z == 42
x == 45
c == 0
The final value of variable c is 0. The output is the remainder left over when c is divided by 10, which is 0 (the answer).
Here is the output of the C code.
3. Example 2
Here is the C code.
Here are the final values of the variables in the program (main).
g == 3
a == 4
u == 10
h == 40
w == 0
The final value of variable w is 0. The output is the remainder left over when w is divided by 10, which is 0 (the answer).
Here is the output of the C code.
4. Example 3
Here is the C code.
Here are the final values of the variables in the program (main).
r == 5
y == 4
e == 1
m == 28
u == 29
The final value of variable u is 29. The output is the remainder left over when u is divided by 10, which is 9 (the answer).
Here is the output of the C code.