C Programming Knowledge Quiz
3 Questions
2 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 of the following is a valid way to declare a one-dimensional array in C?

  • int array[5]; (correct)
  • array = int[5];
  • int array = [5];
  • array[5] = int[];
  • What is the output of the following code snippet in C? int x = 5; printf("%d", x++);

  • 5 (correct)
  • Compiler error
  • 6
  • Undefined behavior
  • Which of the following is true about the 'switch' statement in C?

  • The 'default' case is optional (correct)
  • It allows multiple case labels to match a single expression
  • The 'break' statement is mandatory for each case
  • It can be used with float and double data types
  • Use Quizgecko on...
    Browser
    Browser