
Programming Foundation with C — Article 1: Variables, Data Types & Arrays
Welcome to the first article in my "Programming Foundation with C" series. Before we start writing C code, there are three core concepts you need to understand. Master these and the rest of programming starts to make sense: Variables Data Types Arrays Let's get into it. 1. Variables When you write a program, you almost always need to work with values — names, numbers, scores, ages, whatever. Those values need to live somewhere while your program is running. That somewhere is your computer's memory — the RAM. A variable is just a named location in that memory. You give it a name so you can find it and use it later. Here's the simplest example: #include <stdio.h> int main() { int age = 25; printf("%d", age); return 0; } This program stores the number 25 in memory, labels that location age, and prints it. That's it. Clean and simple. Naming Rules (you must follow these) Cannot start with a number → 1name ❌ Cannot contain spaces → my age ❌ Cannot be a reserved word → int, for, while ❌ Best
Continue reading on Dev.to Beginners
Opens in a new tab




