--- id: csharp-conditions-else title: "C# The else Statement" category: "Programming_Language" status: "draft" verification_status: "conceptual" canonical_id: "" aliases: ["else statement C#", "C# else λ¬Έ"] duplicate_of: "" source_trust_level: "B" confidence_score: 0.82 created_at: 2026-07-04 updated_at: 2026-07-04 review_reason: "" merge_history: [] tags: ["csharp", "programming-language", "w3schools", "conditions", "else"] raw_sources: ["https://www.w3schools.com/cs/cs_conditions_else.php"] applied_in: [] github_commit: "" --- # [[CSharp Conditions Else]] ## 🎯 ν•œ 쀄 톡찰 (One-line insight) This is the exact same `if (time >= votingAge) {...} else {...}` pattern already demonstrated in the Booleans chapter's voting example β€” the tutorial reuses the identical time/greeting scenario here with formal syntax framing, confirming this series deliberately teaches a concept informally (Booleans) before returning to name and formalize it (Conditions), rather than introducing each construct exactly once. [S1] ## 🧠 핡심 κ°œλ… (Core concepts) - **`else`** β€” specifies a block of code to execute when the `if` condition is `False`. [S1] - **Syntax**: `if (condition) { // True branch } else { // False branch }` β€” exactly one of the two blocks ever executes. [S1] ## πŸ“– μ„ΈλΆ€ λ‚΄μš© (Details) - Example: `int time = 20; if (time < 18) { Console.WriteLine("Good day."); } else { Console.WriteLine("Good evening."); }` β†’ since `20` is NOT less than `18`, the condition is False, so the `else` branch runs, printing `"Good evening."`. [S1] ## βš–οΈ λͺ¨μˆœ 및 μ—…λ°μ΄νŠΈ (Contradictions & updates) - **Booleans μ±•ν„°μ˜ 예제 νŒ¨ν„΄μ΄ κ·ΈλŒ€λ‘œ μž¬μ‚¬μš©λ¨**: Booleans μ±•ν„°μ—μ„œ 이미 νˆ¬ν‘œ μ—°λ Ή 예제둜 if/elseλ₯Ό 미리 λ³΄μ—¬μ€¬λŠ”λ°, 이번 μ±•ν„°λŠ” μ‹œκ°„λŒ€(time) μΈμ‚¬λ§μ΄λΌλŠ” λ‹€λ₯Έ μ†Œμž¬μ§€λ§Œ λ™μΌν•œ "if 쑰건 β†’ else λŒ€μ•ˆ" ꡬ쑰λ₯Ό 곡식 문법 μ„€λͺ…κ³Ό ν•¨κ»˜ λ‹€μ‹œ μ œμ‹œν•œλ‹€λŠ” 점이 확인됨 β€” 이 μ‹œλ¦¬μ¦ˆλŠ” κ°œλ…μ„ λΉ„κ³΅μ‹μ μœΌλ‘œ λ¨Όμ € 보여쀀 λ’€(Booleans) λ‚˜μ€‘μ— κ³΅μ‹μ μœΌλ‘œ λͺ…λͺ…Β·μ„€λͺ…(Conditions)ν•˜λŠ” 방식을 취함. [S1] ## πŸ› οΈ 적용 사둀 (Applied in summary) ν˜„μž¬ μ‹œκ°(time=20)이 18보닀 μž‘μ€μ§€ 확인해 "Good day."/"Good evening."을 좜λ ₯ν•˜λŠ” μ˜ˆμ œκ°€ μ›λ¬Έμ—μ„œ 직접 μ‹€μ „ ν™œμš© μ‚¬λ‘€λ‘œ μ œμ‹œλ¨. [S1] ## πŸ’» μ½”λ“œ νŒ¨ν„΄ (Code patterns) if/else β€” exactly one branch executes (C#): ```csharp int time = 20; if (time < 18) { Console.WriteLine("Good day."); } else { Console.WriteLine("Good evening."); } // Outputs "Good evening." ``` ## βœ… 검증 μƒνƒœ 및 신뒰도 - **μƒνƒœ:** draft - **검증 단계:** conceptual - **좜처 신뒰도:** B (W3Schools β€” widely used educational reference, not a primary standards body) - **μ‹ λ’° 점수:** 0.82 - **쀑볡 검사 κ²°κ³Ό:** μ‹ κ·œ 생성 (New discovery) ## πŸ”— 지식 κ·Έλž˜ν”„ (Knowledge Graph) - **μƒμœ„/루트:** [[C# Tutorial]] - **κ΄€λ ¨ κ°œλ…:** [[CSharp Conditions]], [[CSharp Conditions ElseIf]], [[CSharp Booleans]] - **μ°Έμ‘° λ§₯락:** Conditions μ„Ήμ…˜ β€” The else if Statement μ±•ν„°λ‘œ 이어짐. ## πŸ“š 좜처 (Sources) - [S1] W3Schools β€” C# The else Statement β€” https://www.w3schools.com/cs/cs_conditions_else.php ## πŸ“ λ³€κ²½ 이λ ₯ (Change history) - 2026-07-04: Initial draft synthesized from the W3Schools "C# The else Statement" page (Astra wiki-curation, P-Reinforce v3.1 format).