C programming question 78 What is wrong in the following C f
C programming question 7-8.
What is wrong in the following C function? (Selecting the wrong answer deducts 20%) int[] fillArray(int n, int* pval){int a[n]; int j; scan f(\"%d\", pval); for (j = 0; jSolution
7)Ans)C
Reason: If we want to retirn an array from a function we have to use this as below:
int * int* fillArray(int n,int *pval)
{
--------------
--------------
---------------
return a;
}
8)Ans) inc(&scores[2]);
Reason: If we use & symbol along with input value while calling the function.Then we will get the new value if we performed any operations on the variable value.
![C programming question 7-8. What is wrong in the following C function? (Selecting the wrong answer deducts 20%) int[] fillArray(int n, int* pval){int a[n]; int C programming question 7-8. What is wrong in the following C function? (Selecting the wrong answer deducts 20%) int[] fillArray(int n, int* pval){int a[n]; int](/WebImages/33/c-programming-question-78-what-is-wrong-in-the-following-c-f-1097723-1761579299-0.webp)