C

C Fundamentals

18 lessons

Progress0%
1. Introduction to C
1What is C?
2. Variables and Data Types
1Data Types in C
3. Control Flow
ConditionalsLoops
4. Functions
Defining FunctionsRecursion
5. Arrays and Pointers
Arrays and StringsPointers
6. Memory Management
Dynamic MemoryStructs and Files
7. Preprocessor & Macros
Preprocessor DirectivesMacros & Inline Functions
8. Bitwise Operations
Bitwise OperatorsBit Flags & Masking
9. Enums, Unions & typedef
Enums & typedefUnions & Complex Types
10. Multi-file Programs
Header Files & Compilation UnitsLinkage, Storage Classes & Make
All Tutorials
CIntroduction to C
Lesson 1 of 18 min
Chapter 1 · Lesson 1

What is C?

C is a general-purpose, procedural programming language developed by Dennis Ritchie at Bell Labs in 1972. It's one of the most influential programming languages ever created.

Why Learn C?

  • Foundation: Understanding C helps you understand how computers work
  • Performance: Compiles to efficient machine code
  • Portability: Available on virtually every platform
  • Influence: Syntax influenced C++, Java, JavaScript, C#, and many others
  • Systems Programming: Operating systems, embedded systems, drivers

Key Characteristics:

  • Low-level memory access via pointers
  • Manual memory management
  • Minimal runtime overhead
  • Direct hardware access
  • Small standard library

Where C is Used:

  • Operating systems (Linux, Windows kernel)
  • Embedded systems and IoT
  • Game engines
  • Database engines
  • Compilers and interpreters

Code Examples

Hello Worldc
#include <stdio.h>

int main() {
    // Print to console
    printf("Hello, World!\n");
    
    // Variables must be declared with types
    int age = 25;
    float height = 5.9;
    char grade = 'A';
    
    // Formatted output
    printf("Age: %d\n", age);
    printf("Height: %.1f\n", height);
    printf("Grade: %c\n", grade);
    
    // String (character array)
    char name[] = "C Programming";
    printf("Learning: %s\n", name);
    
    return 0;  // Success exit code
}

C uses printf for formatted output with format specifiers: %d for int, %f for float, %c for char, %s for string.

Quick Quiz

1. Who created the C programming language?

2. What does the #include directive do?

Was this lesson helpful?

OverviewNext