Guide · C Programming Language
C Programming Language – Learning Guide
C is one of the oldest and most influential programming languages. It is widely used for operating systems, microcontrollers, and applications where execution speed and efficient use of resources are important. Its compact syntax also makes it a popular first language in schools and introductory programming courses.
This guide follows a recommended learning path: from your first C program and basic data types to control flow, functions, arrays, pointers, structures, and file handling. It also includes links to practice tasks and solutions written in C.
- Primary and secondary school
- Beginner level
- Examples in C
Some lessons and practice materials linked below are currently available only in Serbian. They are marked (Serbian) so you can identify them before opening the page.
1 C language fundamentals
Learn how a C program is organised, how variables and data types work, and how to use operators in expressions.
Introduction to the C Programming Language
Learn about the language, its history, main features, common uses, and development tools.
Open lesson →Basic Elements of C (Serbian)
Keywords, identifiers, comments, and the basic structure of a C program.
Open lesson →Data in C
Variables and data types, input with scanf, and output with printf.
Operators in C
Arithmetic, relational, logical, and bitwise operators, including operator precedence.
Open lesson →2 Selection statements and loops
Learn how a program makes decisions, repeats instructions, and uses one loop inside another.
Selection Statements (Serbian)
Use if, if-else, and switch to choose which instructions a program executes.
Loops in C
Use for, while, and do-while loops, counters, and running totals.
Nested Loops (Serbian)
Use a loop inside another loop to create tables, print patterns, and process matrix elements.
Open lesson →3 Functions
Divide a program into smaller, reusable parts. Learn how to define and call functions, pass arguments, and return values.
4 Arrays, matrices, and strings
Work with collections of values of the same type, two-dimensional data, and text represented as character arrays.
Arrays in C
Array declarations, input, output, indexing, and common array-processing algorithms.
Open lesson →Two-Dimensional Arrays (Matrices) (Serbian)
Represent data in rows and columns and process rows, columns, and diagonals.
Open lesson →Strings in C
Character arrays, functions from string.h, and text processing.
5 Pointers, structures, and files
Explore topics that give you more control over memory and data organisation in C.
Pointers in C (Serbian)
Memory addresses, the & and * operators, and the relationship between pointers and arrays.
Dynamic Arrays and Matrices (Serbian)
Allocate memory with malloc and calloc, and release it with free.
Structures in C (Serbian)
Use struct and typedef, arrays of structures, the -> operator, and qsort.
File Handling in C (Serbian)
Work with fopen, fclose, fscanf, fprintf, fgets, and freopen.
6 C practice tasks and solutions
Use these tasks to practise what you have learned. Try to solve each problem on your own before opening its solution.
Data Types and Operators – Practice Test (Serbian)
Check your understanding of data types, variables, and operators.
Open task →Speed During Free Fall (Serbian)
Apply physical formulas and work with real numbers.
Open task →Car Race – Solution (Serbian)
Practise selection statements and comparisons between values.
Open solution →Character Codes – Solution (Serbian)
Work with characters and ASCII codes.
Open solution →First and Second in a Ranking – Solution (Serbian)
Find the two largest values in a single pass through the data.
Open solution →More Programming Tasks with Solutions (Serbian)
Browse additional solved examples from different programming topics.
Open guide →✎ A short C example
This program reads two integers and prints their sum.
#include <stdio.h>
int main(void) {
int a, b;
/* Read two integers */
printf("Enter two numbers: ");
scanf("%d %d", &a, &b);
/* Print their sum */
printf("The sum is: %d\n", a + b);
return 0;
}
