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 functions.
Note that all functions use call by value and return a value to be used in an expression (in the right part of an assignment statement).
2. Example 1
Here is the C code.
Here are the final values of the variables in the program (main).
f == 3
a == 7
p == 1
e == 7
z == 21
The final value of variable z is 21. The output is the remainder left over when z is divided by 10, which is 1 (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).
e == 6
x == 5
k == 12
c == 4
f == 24
The final value of variable f is 24. The output is the remainder left over when f is divided by 10, which is 4 (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).
k == 3
m == 4
e == 21
v == 0
w == 21
The final value of variable w is 21. The output is the remainder left over when w is divided by 10, which is 1 (the answer).
Here is the output of the C code.