← The C Language Lesson 38 of 77 · 5 XP

Warm-up: a point warm-up

Theory and problem statement

Machine translation, not yet reviewed by a native speaker.

A structure groups several values under one name. You reach a field with a dot:

struct point {
    int x;
    int y;
};

struct point p;
p.x = 3;
p.y = 4;
printf("(%d, %d)\n", p.x, p.y);   // (3, 4)

Task. Read two numbers into the fields x and y of the structure and print the point as (x, y).

Sign up for free to solve this task right in your browser: code editor, running, test checks and hints.