Loading your page…
YOUR LEARNING PATH
Short exercises, progressive hints and explanations to help you move forward.
Create a free account to access the lessons and save your progress. Free learning uses daily hearts.
Create my accountAlready have an account? Log inLearn C to understand types, arrays and memory. Progress from basic output to functions, pointers and structures.
Before you start: The course starts with the basics. Read compiler messages carefully as you practise.
#include <stdio.h>
int main(void) {
int values[] = {2, 4, 6};
int total = 0;
for (int i = 0; i < 3; i++) total += values[i];
printf("%d\n", total);
return 0;
}The array holds three integers. The loop uses indices 0, 1 and 2. The condition i < 3 avoids reading past the last element.
Try it: Replace 6 with 10 and calculate the new total before compiling.
Want to understand what each plan includes? Compare plans
C teaches computer science fundamentals that higher-level languages conceal: memory management, pointers, and CPU-level execution. It builds exceptional engineering rigor.