Color theme
0 day streak0 XPP1
CQuiz mode
MISSION 1 OF 3

Correct a plant label

0 XP earned
C track: AdvancedMission: BeginnerCharacter arraysArray indexingCharacter literals
Before you start this advanced track

Arrays and functions, plus the basics of memory addresses, pointers, and byte sizes.

Guided code reading and debugging. Runnable coding challenges are available in JavaScript, Python, and SQL.

x
0 / 6 challenges
KNOWLEDGE CHECK

Predict the result.

What plant label is printed?

mission.c
#include <stdio.h>int main(void) {  char label[] = "moss";  label[0] = 'M';  printf("%s\n", label);  return 0;}

Each example is a complete C11 console program. Compile as C, not C++. Arrays are local objects with the sizes shown; no input or external files are needed.

Review the lesson

A character array initialized from a string contains editable characters followed by a terminating zero byte. Array indexes begin at zero. Assigning a single-quoted character to one array element replaces just that character. The %s format prints the characters through the end of the string, stopping before its zero terminator.

Choose your answer+25 XP on first completion