Podcast
Questions and Answers
Which of the following is a valid way to declare a one-dimensional array in C?
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++);
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?
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