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

© 2026 BraveProgrammer. All rights reserved.

  1. Courses
  2. /
  3. C Programming Fundamentals

Lesson 10 of 50 · c

Loops – for

Duration: 7 mins

for is the most common loop for counting.

for (int i = 0; i < 10; ++i) {
    printf("%d ", i);
}

The three parts are:

  1. initialization – executed once.
  2. condition – evaluated before each iteration.
  3. iteration expression – executed after each iteration.

You can omit any part if not needed (e.g., infinite loop).

Previous: Loops – while & do / whileNext: Functions – Declaration & Definition