SyntaxStudy
Sign Up
C Beginner 8 min read

Introduction to C

C is one of the most foundational programming languages ever created. Developed at Bell Labs in the early 1970s, C has influenced nearly every modern programming language including C++, Java, Python, and JavaScript.

C gives you direct control over memory and hardware, making it the language of choice for operating systems, embedded systems, and performance-critical applications.

Example
#include <stdio.h>
#include <stdlib.h>

// Function declaration
int add(int a, int b);
void greet(const char* name);

int main() {
    // Basic I/O
    printf("Hello, World!\n");

    // Variables
    int x = 10, y = 20;
    float pi = 3.14159;
    char letter = 'A';

    // Function calls
    printf("Sum: %d\n", add(x, y));
    greet("Alice");

    // Pointer basics
    int value = 42;
    int *ptr = &value;
    printf("Value: %d, Address: %p\n", *ptr, (void*)ptr);

    return 0;
}

int add(int a, int b) { return a + b; }
void greet(const char* name) { printf("Hello, %s!\n", name); }