A1 - hello world

anatomy of a C program

#include <stdio.h>                        // importing external code, here importing printf


// start of the program
int main() {                                      // entry point; int denotes that an integer is returned
    printf("Hello World!\n");   // semi colons indicate the end of a line
    return 0;                                 // returning zero from main indicates successful execution
}          

header files

// defining constants
#define CAR_WHEEL_COUNT 4

// declaring available functions
void drive();
int get_id();
char* get_vin();
#include "car.h"

// contains actual implementation

void drive() {
    printf("Driving");
}

...