C-Array Questions and Answers

C-Array Questions and Answers
1. Array is of
  • scalar type
  • aggregate type
  • union type
  • enumerated type
Show Answer
2. Array name is a
  • variable
  • pointer to constant
  • constant pointer
  • constant
Show Answer
3. The only operatr that can act on the arrray as a whole is
  • indirection operator
  • sizeof operator
  • { }
  • [ ]
Show Answer
4. Which of the following is true about array?
  • Array elements are stored in contiguous memory locations
  • In c arrays are stored in row-major order
  • An array can be declared as local as well as global
  • All the above
Show Answer
5. Identify the true statement
  • memory allocated by an array can be deallocated using free () function
  • C also supports zero length array
  • array can be used to hold dissimilar kinds of data
  • working beyond array size is not risky
Show Answer
6. Fnd the output
'void main ( )
{
char a[4]="rama";
char b[ ] ="shyama";
printf{"%d %d", sizeof (a), sizeof (b));
}

  • 4 7
  • 5 6
  • 5 7
  • 4 6
Show Answer
7. Find the output
void main ()
{
char a[ ] ="rama";
har b [ ]=a;
printf("%d %s", sizeof (b), b);
}

  • 5 rama
  • 4 rama
  • 5 r
  • Compilation error
Show Answer
8. Find the output
void main()
{
int a[ ] ={'a'a, 'b', 'c'};
printf("%d", sizeof (a));
}



  • 3
  • 4
  • Can't be initialized
  • None of these
Show Answer
9. It is said that the arrray uses "zero-basee addressing"because
  • Array size must be an integer greater than zero
  • The array subscript must always start at zero.
  • Array declaration reserves memory during compilation
  • None of these
Show Answer
10. Which is the about array ?

  • Array can be dynamic
  • Using malloc, memory an be allocated for array during run time
  • Unused memory can't be used at the time of requirement
  • None of these
Show Answer
Questions and Answers for Competitive Exams Various Entrance Test