TOTAL QS = 20Time [ 00 : 00 : 00 ]
00:00:00

C Programming Basics Tutorial - Arrays, Multidimensional Arrays and Pointers - Online Test 2

Instructions

Total Questions: 20

Total Minutes: 20

This ExamTray Free Online Exam tests your C Programming Skills on C Arrays, Multidimensional Arrays and Pointers to Arrays. Examples are given as questions and answers. Easily Attend Competitive Exams and Job Interview Questions.

Go through C Theory Notes on Arrays before attempting this test.

All the Best

Challenge SCORE

0 / 20

Take This Exam
1) What is the output of C program with arrays and pointers.?
int main()
{
    int size=4;
    int a[size];
    a[0]=5;a[1]=6;
    a[2]=7;a[3]=8;
    printf("%d %d", *(a+2), a[1]);
}
2) What is the output of C program with arrays.?
int main()
{
    int ary(3)=[20,30,40];
    printf("%d", a(1));
}
3) What is the output of C Program with arrays.?
int main()
{
    int rollno[3]=[1001,1002,1003];
    printf("%d", rollno[1]);
}
4) What is the output of C program with arrays.?
int main()
{
   char grade={'A','B','C'};
   printf("%c", grade[0]);
}
5) What is the value of an array element which is not initialized.?
6) What happens when you try to access an Array variable outside its Size.?
7) What is the size of an array in the below C program statement.?
int main()
{
    int ary[9];
    return 0;
}
8) What is the minimum and maximum Indexes of this below array.?
int main()
{
    int ary[9];
    return 0;
}
9) Can we change the starting index of an array from 0 to 1 in any way.?
10) What is the need for C arrays.?
11) What is the output of C program with arrays.?
int main()
{
    int ary[4], size=4;
    printf("%d ", ary[size]);
    return 0;
}
12) What is the output of C Program with arrays.?
int main()
{
    int ary[4];
    ary[4] = {1,2,3,4};
    printf("%d ", ary[2]);
    return 0;
}
13) What is the output of C Program with arrays.?
int main()
{
    int ary[3]={1,2};
    printf("%d %d",ary[2]);
    return 0;
}
14) What is a multidimensional array in C Language.?
15) If an integer array pointer is incremented, how many bytes will be skipped to reach next element location.?
16) What is the output of C Program with arrays and pointers.?
int main()
{
    int ary[] = {10,20,30}, *p;
    p = &ary[0];
    int i=0;
    while(i<3)
    {
        printf("%d ", *p);
        p++;
        i++;
    }
    return 0;
}
17) What is the function used to allocate memory to an array at run time with Zero initial value to each.?
18) What is the function used to allocate memory to an array at run time without initializing array elements.?
19) Choose a correct Syntax for malloc() function to allocate memory to an array at run time.
20) What is the syntax of CALLOC to allocate memory to an array at runtime.?
Certification Group ID
3858

Open Certification Helper Popup Reset Popup