Array in C MCQs Exercise II

Ques 1 Array


What is the value printed by the following C program ?

#include
int f(int *a,int n)
{
    if(n<=0) return 0;
    else if(*a%2==0) return *a+f(A+1,n-1);
    else return *a-f(a+1,n-1);
}
int main( )
{
    int a[]={12,7,13,4,11,6};
    printf("%d",f(a,6));
    return 0;
}

A -9
B 5
C 15
D 19

Ques 2 Array


Array Index starts with ?

A 0
B 1
C 2
D 3

Ques 3 Array


What is the value printed by the following C program ?

#include
int f(int a,int b)
{
    return a,b;
}
int main( )
{
    int a=10,b=8;
    printf("%d %d %d",f(a,b),a,b);
    return 0;
}

A 10 10 8
B 10 10 10
C 8 10 8
D None of these