Skip to content

Beta · Data may be lost.Your data may be reset or lost.

GateBrew
← GATE CSE 2021 Set 1
Questions

Q48

NAT2 marksAlgorithms

Consider the following ANSI C\text{ANSI C} function:

int SimpleFunction(int Y[], int n, int x)
{
    int total = Y[0], loopIndex;
    for (loopIndex=1; loopIndex<=n-1; loopIndex++)
        total=x*total +Y[loopIndex];
    return total;
}

Let Z\textsf{Z} be an array of 1010 elements with Z[i]=1\textsf{Z}[i]=1, for all ii such that 0≤i≤90 \leq i \leq 9. The value returned by SimpleFunction(Z,10,2)\textsf{SimpleFunction(Z},10,2) is __________

Sign in to save attempts.

The solution is hidden while you attempt this question. It opens once you check or show the answer.