Menu
Coddy logo textTech

Practice #1

Lesson 6 of 8 in Coddy's C/C++ Structures course.

challenge icon

Challenge

Easy

You are given some code, create a Car structure to match the rest of the code.

Try it yourself

#include <stdio.h>

// Create the structure here

int main() {
    struct Car car1 = {"BMW", "Sport Hatchback", 2017};
    struct Car car2 = {"Audi", "Seden", 2020};
    struct Car car3 = {"Ford", "Bronco", 2023};
    
    printf("%s %s %d\n", car1.brand, car1.model, car1.year);
    printf("%s %s %d\n", car2.brand, car2.model, car2.year);
    printf("%s %s %d\n", car3.brand, car3.model, car3.year);
    
    return 0;
}

All lessons in C/C++ Structures