Answers
ANSWER
Q7.1
int num = 5;
myFunc(num);
Ans -)
It is pass by value not reference in this we just pass num which is recieved by another variable in the myFunc() which is a copy of num value.
Q7.2
int num = 5;
myFunc(&num);
Ans -)
It is passed by reference.
Because in parameter passing &num is passed which means the address of num variable is passed. So it is not a copy any changes in that address value also reflect in the num.
Q7.3
int num[] = {5};
myFunc(num);
Ans -)
It is passed by refrence.
Whenever we pass the array to the function it is pass by refrence.
When we pass the array then the refrence of array is passed so changes in different array reflects the changes in the original array also.
Q7.4
int num[] = {5,6,7,8,9};
myFunc(num);
Ans -)
It is also a passed by refrence.
Whenever we pass the array to the function it is pass by refrence.
When we pass the array then the refrence of array is passed so changes in different array reflects the changes in the original array also.
Q7.5
char name[6] = "Hello";
myFunc(name);
Ans -)
It is also a passed by reference.
Because value passed with array is pass by reference.
If any changes in the passed array will also reflect in the original array.
.