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; j

Solution

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

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site