Cis 1101 - Programming 1: Function in C
Cis 1101 - Programming 1: Function in C
Cis 1101 - Programming 1: Function in C
FUNCTION IN C
Part 2
2
24 Mar 2020
int a, b;
int total;
a = 75;
b = 86;
total = calcSum(a,b);
4
24 Mar 2020
6
24 Mar 2020
8
24 Mar 2020
Actual parameter:
• The actual value that is passed into the function
by a caller, and it is often called as argument.
Formal parameter:
• The identifier used in a function to stand for the
value that is passed into the function by a caller.
10
24 Mar 2020
11
12
24 Mar 2020
b) Write the code of the program described above using the created function and verify its output.
c) Create a function using pointers that will swap the values assigned to the given two variables d
and e using Pass-By-Reference.
d) Write the code of the program described above using the created function and verify its output.
13
14
24 Mar 2020
15