Array In C programming. Multiple Choice Questions related to Array In C programming and types of Array In C programming.
What is the meaning of the following declaration ??
int arr[20];
A.Integer Array of size 20
B.None of these
C.An array of size 20 that can have an integer address
D.An array of Size 20
The size of the array should always be ??
A. Positive
B. Negative
C. Whole number
D. Real number
What is the effect of the following code ??
main()
{
int a[4]={1,5};
printf(“%d”,a[3]);
}
A. 0
B. Syntax error because of improper initialization
C. 5
D. Syntax error because of invalid index
What will be the output of the C program ??
#include<stdio.h>
int main()
{
float arr[] = {12.4, 2.3, 4.5, 6.7};
printf(“%d\n”, sizeof(arr)/sizeof(arr[0]));
return 0;
}
A. 5
B. 4
C. 6
D. 7
What will be the output of this C program ??
#include<stdio.h>
int main()
{
int arr[1]={10};
printf(“%d\n”, 0[arr]);
return 0;
}
A. 1
B. 10
C. 0
D. 6
What will be the output of the program if the array begins at 65472 and each integer occupies 2 bytes ??
#include<stdio.h>
int main()
{
int a[3][4] = {1, 2, 3, 4, 4, 3, 2, 1, 7, 8, 9, 0};
printf(“%u, %u\n”, a+1, &a+1);
return 0;
}
A. 65474, 65476
B. 65480, 65496
C. 65480, 65488
D. 65474, 65488