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 7 of 50 · c

Control Flow – if / else

Duration: 6 mins

if statements execute a block when a condition is true. An optional else clause runs when the condition is false.

if (x > 0) {
    printf("positive\n");
} else {
    printf("non‑positive\n");
}
Previous: Operators OverviewNext: Control Flow – switch