arrays-mcq-1 (1)
arrays-mcq-1 (1)
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]);
}
A) 8 6
B) 7 6
C) 6 6
D) Compiler error
A) 20
B) 30
C) 0
D) Compiler error
A) 1002
B) 1003
C) address of 1002
D) Compiler error
A) A
B) B
C) C
D) Compiler error
int main()
{
int ary[9];
return 0;
}
A) -1, 8
B) 0, 8
C) 1,9
D) None of the above
int main()
{
int ary[4], size=4;
printf("%d ", ary[size]);
return 0;
}
A) 0
B) 1
C) Random number
D) Compiler error
A) 2
B) 3
C) 0
D) Compiler error
32) What is the output of C Program with arrays.?
int main()
{
int ary[] = {1, 3, 5};
printf("%d %d", ary[-1], ary[4]);
return 0;
}
A) 1 5
B) 0 0
C) Compiler error
D) None of the above
A) 0 0
B) -1 -1
C) Compiler error
D) None of the above
A) 11 55
B) 11 13
C) 11 33
D) Compiler error
A) 6 1
B) 6 2
C) 5 1
D) Compiler error
37) Choose an alternative definition of C Multidimensional
array.?
int ary[][3] = {6,5,4,3,2,1};
A) 10
B) 11
C) 12
D) Compiler error