C Array Declaration and Initialization Quiz
5 Questions
1 Views

Choose a study mode

Play Quiz
Study Flashcards
Spaced Repetition
Chat to Lesson

Podcast

Play an AI-generated podcast conversation about this lesson

Questions and Answers

Which symbol is used to show that a data element is an array in C?

  • ( )
  • < >
  • { }
  • [ ] (correct)

What is the syntax to declare and create an array in C?

  • dataType arrayName[arraySize]; (correct)
  • arrayName = [dataType] arraySize;
  • arraySize = dataType[arrayName];
  • arrayName[dataType] = arraySize;

In C, from which index do the indices of arrays start?

  • Depends on the array size
  • 1
  • 0 (correct)
  • -1

What is the correct way to initialize an array of 4 integers: 43, -9, 19, 33 in C?

<p>int data[] = {43, -9, 19, 33}; (B)</p> Signup and view all the answers

What is the statement to initialize all elements of an array of size 10 to 0 in C?

<p>int data[10] = {0}; (C)</p> Signup and view all the answers

More Like This

Use Quizgecko on...
Browser
Browser