
Get Started in C
Getting started with C programming is simple and exciting! ?
Here�s a step-by-step guide to run your first C program � even if you�re brand new!
?? Step 1: Setup
? Install a C Compiler
Windows: Code::Blocks, MinGW
Mac: Install Xcode Command Line Tools:
xcode-select --install
Linux: Use
gcc
? install withsudo apt install build-essential
Or use an online compiler like https://www.programiz.com/c-programming/online-compiler
? Step 2: Write Your First C Program
int main() { printf("Hello, World!\n"); return 0;}
? Step 3: Save the File
Save it as hello.c
? Step 4: Compile & Run
Using Terminal or Command Prompt:
gcc hello.c -o hello # Compile./hello # Run (or just `hello` on Windows)
Output:
Hello, World!
? Basic Structure of a C Program
#include // Header fileint main() { // Main function // Your code here return 0; // Exit code}
? Key Concepts to Learn Next
Variables & Data Types
Input/Output (
scanf
,printf
)Operators
Control Structures: if, switch, loops
Functions
Arrays, Pointers, Strings
File Handling