Kodewick
Start learning →
Mini challenge←→0 / 70

Mug initials

#044Mini challengeStringsConditions5 min

A mug for a friend gets her initials. The names in name are separated by one space; print the first letter of each, all together: Mei Lin Chen prints MLC.

Should show
MLC
main.c
#include <stdio.h>

int main(void) {
    char name[] = "Mei Lin Chen";
    for (int i = 0; name[i] != '\0'; i++) {
        // your code here: if it is the first character or follows a space, print it with %c
    }
    printf("\n");
    return 0;
}
Ctrl + Enter runs too
Result

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