Published on
· July 10, 2026

The C language: what it is and how to start programming

Blog
  • Photo of Henrico Piubello
    Henrico Piubello
    Henrico Piubello
    IT Specialist - Grupo Voitto

    IT Specialist - Grupo Voitto

Logo of the C programming language highlighted on a blue background

C is a compiled general-purpose programming language, created by Dennis Ritchie in 1972 at Bell Labs, used to build operating systems, drivers, and embedded systems. By offering direct control over memory, C remains the foundation of critical software, from the Linux kernel to databases.

What is the C language?

The C language is a compiled, procedural, statically typed language, created by Dennis Ritchie at Bell Labs to rewrite the Unix operating system. The compiler translates source code directly into machine instructions, which guarantees performance close to the hardware and lean binaries — the reason C still dominates operating systems and embedded systems more than 50 years later.

Ritchie himself described the result in the article "The Development of the C Language" (1993): "C is quirky, flawed, and an enormous success". This success shaped the syntax of C++, Java, JavaScript, Go, and many other languages that came later.

The C language also continues to evolve: the most recent standard is C23, published by ISO as ISO/IEC 9899:2024 in 2024, with improvements in type safety, new attributes, and features borrowed from modern C++.

Hello World in C

The "Hello, World!" program in C fits in five lines and presents the minimal structure of any code in the language:

#include <stdio.h>
int main() {
    printf("Hello, World!\n");
    return 0;
}

In this program, #include <stdio.h> includes the standard input/output library in C, which provides the printf function to print text to the console.

Next, we have the main() function, which is the program's entry point. Inside it, we use printf to print "Hello, World!" to the console, and \n creates a new line.

Finally, return 0; indicates that the program ran successfully. When you compile and run this code, the console will display "Hello, World!".

Why is the C language still important in 2026?

The C language remains relevant because it dominates the niches where performance and memory control are non-negotiable. In the TIOBE index for 2026, C holds the 2nd position among the most popular languages in the world, driven by the growth of embedded systems and IoT (Internet of Things) — learn more about this ranking in our comparison of the 7 most used programming languages.

Four characteristics explain this longevity:

  • Efficiency: C generates code that runs quickly and consumes few system resources, with no garbage collector or intermediate layers.
  • Portability: C programs compile on virtually any system and architecture, from microcontroller to supercomputer.
  • Low level: C offers direct control over memory and hardware, ideal for operating systems, drivers, and firmware. The Linux kernel is written in C — since version 5.18 (2022), in the gnu11 dialect of the C11 standard.
  • Community and legacy: decades of libraries, mature compilers like GCC (GNU Compiler Collection) and Clang, and a gigantic base of code in production ensure continuous demand for those who master the language.

What are the fundamentals of syntax in C?

C's syntax rests on four blocks: variables, data types, control structures, and functions. The table summarizes the most used primitive types in day-to-day work:

TypeWhat it storesExample
intIntegersint idade = 25;
floatSingle-precision decimalsfloat altura = 1.75;
doubleDouble-precision decimalsdouble pi = 3.14159;
charA single characterchar letra = 'A';
char[]Character stringschar nome[] = "Ana";

Variables in C

Variables in C must be declared with a fixed type before use:

#include <stdio.h>

int main() {
    int idade = 25;
    float altura = 1.75;
    char letra = 'A';

    printf("Idade: %d\n", idade);
    printf("Altura: %.2f\n", altura);
    printf("Letra: %c\n", letra);

    return 0;
}

In this example, we declare three variables — idade (integer), altura (floating point), and letra (character) — and use printf with the specifiers %d, %.2f, and %c to display each value.

Control structures in C

The control structures if/else, for, and while define conditional decisions and repetitions:

#include <stdio.h>

int main() {
    int numero = 10;

    if (numero > 5) {
        printf("O número é maior que 5.\n");
    } else {
        printf("O número é menor ou igual a 5.\n");
    }

    for (int i = 0; i < 5; i++) {
        printf("Contagem: %d\n", i);
    }

    while (numero > 0) {
        printf("Número: %d\n", numero);
        numero--;
    }

    return 0;
}

The if/else evaluates a condition, the for repeats a block a defined number of times, and the while repeats as long as the condition is true.

Functions in C

Functions in C encapsulate reusable logic, always with a return type and declared parameters:

#include <stdio.h>

int soma(int a, int b) {
    return a + b;
}

int main() {
    int resultado = soma(5, 3);
    printf("A soma de 5 e 3 é: %d\n", resultado);
    return 0;
}

Here, the soma function takes two integers and returns the sum; the main function calls it and prints the result.

How to start learning C?

To learn C from scratch, follow these four steps:

  1. Set up the development environment: install the GCC compiler (Linux/macOS) or MinGW (Windows), or adopt an IDE like Code::Blocks or Visual Studio, which bring editing, compilation, and debugging together in one place.
  2. Master the basic syntax: practice variables, types, control structures, and functions until you can write small programs without consulting examples. If conditionals and loops still confuse you, start with our programming logic guide.
  3. Solve exercises every day: deliberate practice is what consolidates pointers, arrays, and memory management — the topics that trip up beginners the most.
  4. Explore the standard libraries: study <stdio.h> for input and output, <stdlib.h> for memory allocation, and <string.h> for string manipulation before moving on to external libraries.

5 sites to practice C

  1. HackerRank: offers a dedicated track of exercises in C, with problems classified by difficulty and competitions to test your skills.
  2. LeetCode: a competitive programming platform with thousands of algorithm and data structure problems that accept solutions in C.
  3. CodeAbbey: brings together various programming problems, suitable for beginners and intermediates, with automatic answer checking.
  4. GeeksforGeeks: an excellent source of tutorials and exercises in C, especially for algorithms and data structures.
  5. W3Resource C Exercises: a broad collection of C exercises categorized by topic — loops, arrays, functions, pointers, and more.

Want to vary the challenges? Also see our selection of 10 sites with programming challenges to level up your skills in any language.

Conclusion

The C language is not a museum piece: it is the foundation on which the Linux kernel, databases, and the firmware of the billions of embedded devices around you right now run. Those who invest time in C learn what most modern languages hide — memory, pointers, compilation — and start reading any stack with different eyes. CodeCrush's recommendation is direct: if your goal is firmware, operating systems, or extreme performance, C is not optional, it is a prerequisite; and even if it is not, mastering its fundamentals will make you a better developer in any language.

## faq

Frequently asked questions

What is the C language for?

The C language is used to build software that requires performance and hardware control: operating systems like the Linux kernel, drivers, embedded systems, databases, and interpreters for other languages. By generating lean, portable machine code, C remains the foundation of much of the modern software infrastructure.

Is it worth learning C in 2026?

Yes. In 2026, C holds the 2nd position of the TIOBE index, driven by embedded systems and IoT. Learning C also strengthens fundamentals of memory, pointers, and compilation that make it easier to master C++, Rust, and Go afterwards. For firmware, kernel, and high-performance systems jobs, C remains a frequent requirement.

What is the difference between C and C++?

C is procedural and minimalist; C++ extends C with object orientation, templates, and a much larger standard library. C favors total control and lean binaries, common in embedded systems and kernels. C++ favors abstractions in large projects, like games and engines. Those who master C learn C++ with less effort.

What do I need to program in C?

You need a compiler and a code editor. GCC (Linux/macOS) and MinGW (Windows) are free, and IDEs like Visual Studio or Code::Blocks bring together editor, compiler, and debugger. Just write a .c file, compile in the terminal, and run the generated binary.

Is C hard for beginners?

C demands more discipline than Python or JavaScript because memory management is manual and pointer errors crash the program. On the other hand, the syntax is small and the concepts learned — memory, types, compilation — apply to any language. With basic programming logic, a beginner progresses well.

## continue lendo

Keep browsing

About the author

Photo of Henrico Piubello

Henrico Piubello

IT Specialist - Grupo Voitto · Grupo Voitto

See profile and all articles