Start learning C

Start with a compiler, an editor and a terminal, or use the online environment in the first step. Attempt each exercise before reading its solution.

1. Prepare somewhere to run your code

Prepare somewhere to run your code

Compile a program and change the message it prints.

2. Get to know data types

Get to know data types

Choose a type for an age, a measurement and a letter.

3. Read and display data

Read and display data

Request a value and check that the output matches your input.

4. Combine input and calculations

Combine input and calculations

Work through the calculation on paper and compare it with the program.

5. Make decisions

Make decisions

Try at least one input for each branch of the condition.

6. Repeat with loops

Repeat with loops

Check when each loop starts and ends.

7. Organise code into functions

Organise code into functions

Move a calculation into a function and use it with two allowed inputs.

Keep going

Browse all topics or explore the book editions. The free sample is from the revised Spanish edition.