C in 100 Seconds: If Else — Grade Calculator in 14 Lines | Episode 5
0views
002:22
T
Taught by Celeste AI - AI Coding Coach
View on YouTubeDescription
Branching in 100 seconds. if checks a condition. else if adds more branches. else catches everything that fell through. Plus the ternary
operator for one-line conditions.
A grade calculator — score 85 hits the second branch and gets a B. Conditions check top to bottom. First match wins. The ternary operator
packs an if/else into one line — question mark for true, colon for false.
Student code: https://github.com/GoCelesteAI/c-in-100-seconds/tree/main/episode05
What You'll Learn:
• if — check a condition
• else if — add more branches
• else — catch everything that fell through
• gt= comparison operator
• Ternary operator — condition ? true : false
• Conditions check top to bottom, first match wins
Next: Episode 6 — Switch Statement
#c #programming #100seconds #learnc #ifelse #conditionals #ternary #branching #tutorial
Tags
c if else, conditionals c, else if c, ternary operator c, branching c, c tutorial 2026, c beginner, 100 seconds, learn c, coding tutorial
Tags
c if elseconditionals celse if cternary operator cbranching cc tutorial 2026c beginner100 secondslearn ccoding tutorial