Skip to main content
Brave Programmer Logo

BraveProgrammer

BraveProgrammer

HomeProjectsBlogsCoursesLessonsAbout

Site footer

BraveProgrammer

Free coding courses, practical tutorials, and real projects from BraveProgrammer. Learn web development with React, Next.js, and TypeScript.

Navigation

  • Home
  • Projects
  • Blogs
  • Courses

Resources

  • About
  • Lessons
  • Teach on BraveProgrammer

© 2026 BraveProgrammer. All rights reserved.

Variables & Constants | C Programming Fundamentals lesson | BraveProgrammer
  1. Courses
  2. /
  3. C Programming Fundamentals

Lesson 5 of 50

·c

Variables & Constants

6 mins

Course progress10%

What you'll learn

Keep these ideas in mind as you work through the lesson.

4 points
  • Declare a variable: `<type> <name> = <initial value>;`
  • `const` qualifies a variable as read‑only.
  • Uninitialized variables contain **indeterminate** (garbage) values.
  • Scope is determined by the block (`{}`) where the variable is declared.

Variables store values of a specific type and must be declared before use. const makes a variable read‑only after initialization.

int age = 30;          // mutable variable
const double PI = 3.14159; // constant, cannot be reassigned
Make it stickPractice what you've learned1 quiz · 3 practical tests · Optional activities from C Programming FundamentalsBrowse activities
Previous lessonData Types & SizesContinue to lesson 6Operators OverviewBack to C Programming Fundamentals curriculum