Kodewick
Start learning →
Basic←→0 / 70

Steps for 3 days

#007BasicOutputLoops4 min

The fitness band saved the steps for three days. Show one line per day, like Day 1: 820: the day with %d (starting at 1) and the steps with %6d, which takes 6 places and lines up on the right, so the numbers line up.

Should show
Day 1:   820
Day 2: 12500
Day 3:  4300
main.c
#include <stdio.h>

int main(void) {
    int steps[3] = {820, 12500, 4300};
    for (int i = 0; i < 3; i++) {
        // your code here: printf the day and its steps (%6d)
    }
    return 0;
}
Ctrl + Enter runs too
Result

Run tries the examples. When they look right, Submit.