1.
The malloc() function returns a null if it fails to allocate the requested memory.
2.
What will happen if in a C program you assign a value to an array element whose subscript exceeds the size of array?
3.
In C, if an array is passed as an argument to a function, which of the following is passed?
4.
What is the output of the following C code:
#include

int main() {
    int a[5] = {
        5,
        1,
        15,
        20,
        25
    };
    int i, j, m;
    i = ++a[1];
    j = a[1]++;
    m = a[i++];
    printf("%d, %d, %d", i, j, m);
    return 0;
}
5.
What is the output of the following C code:
 
#include

void fun(int ** p);

int main() {
    int a[3][4] = {
        1,
        2,
        3,
        4,
        4,
        3,
        2,
        8,
        7,
        8,
        9,
        0
    };
    int * ptr;
    ptr = & a[0][0];
    fun( & ptr);

    return 0;
}

void fun(int ** p) {
    printf("%d
", ** p);
}
6.
What is the output of the following C code:
#include <stdio.h>

int main()
{
int arr[1] = {10};
printf("%d
", 0[arr]);
return 0;
}
7.
What is the output of the following C code:
 
#include
int main() {
    float arr[] = {
        12.4,
        2.3,
        4.5,
        6.7
    };
    printf("%d
", sizeof(arr) / sizeof(arr[0]));
    return 0;
}
8.
If an array begins from 1200 in the memory, what is the output of the following C code:
 
#include
int main() {
    int arr[] = {
        2,
        3,
        4,
        1,
        6
    };
    printf("%u, %u, %u
", arr, & arr[0], & arr);
    return 0;
}
9.
Which of these is the correct way to define the fun() function in the following C code:
 
#include

int main() {
    int a[3][4];
    fun(a);
    return 0;
}
10.
Which of these statements about the following C code is correct:
 
#include

int main() {
    int size, i;
    scanf("%d", & size);
    int arr[size];
    for (i = 1; i <= size; i++) {
        scanf("%d", & arr[i]);
        printf("%d", arr[i]);
    }
    return 0;
}